传教士经验

字符串分割:

‘abc 123   xyz   ’.Split('',[System.StringSplitOptions]::RemoveEmptyEntries)  #去除字符串间长度不一的”空隙“

‘abc 123   xyz   ’ -split "\s+|\t+"  #去除字符串间长度不一的”空隙“

‘abcdefghij’  -split "(..)"  #任意两个字符

 

小数变整数的几种方法:

c是增,[system.math]::Ceiling($a)是进一法。

f是减,[system.math]::Floor($a)是去尾法(去掉小数部分)

 

类似于Linux下tail -f的功能:

Get-Content D:\a.txt -Tail 10 -ReadCount 0 -Wait

posted @ 2015-05-10 20:36  dongdonggeorge  阅读(203)  评论(0编辑  收藏  举报