Difference between revisions of "Split"
From MyWiki
Line 2: | Line 2: | ||
<br> | <br> | ||
'''To get split to work properly to separate out a username with spaces :'''<br> | '''To get split to work properly to separate out a username with spaces :'''<br> | ||
− | PS C:\scripts> $one = 'ab cd | + | PS C:\scripts> $one = 'ab cd ef' |
− | PS C:\scripts> $two = $one -Split(' ') | + | PS C:\scripts> $two = $one -Split(' ') |
− | PS C:\scripts> $two[0] | + | PS C:\scripts> $two[0] |
Latest revision as of 15:13, 27 August 2014
http://www.powershelladmin.com/wiki/Powershell_split_operator
To get split to work properly to separate out a username with spaces :
PS C:\scripts> $one = 'ab cd ef' PS C:\scripts> $two = $one -Split(' ') PS C:\scripts> $two[0]