hebedich 通过本文主要向大家介绍了powershell 字符串,powershell,windows powershell,powershell是什么,powershell下载等相关知识,希望对您有所帮助,也希望大家支持linkedu.com www.linkedu.com
这里有一个简单的方法教你获得一个字符串(不是数组哦)包涵多少行:
$text = @'
This is some
sample text
Let's find out
the number of lines.
'@
$text.Length - $text.Replace("`n",'').Length + 1
</div>
从技术上讲,该示例使用了上面的字符串来创建多行字符串,但是这仅仅是一个例子。只要懂得了它的工作原理就能在多种场合使用。
支持所有的PS版本
</div>
