Difference between revisions of "Split"

From MyWiki
Jump to: navigation, search
(Created page with "http://www.powershelladmin.com/wiki/Powershell_split_operator <Br>")
 
 
(2 intermediate revisions by the same user not shown)
Line 1: Line 1:
http://www.powershelladmin.com/wiki/Powershell_split_operator <Br>
+
http://www.powershelladmin.com/wiki/Powershell_split_operator <br>
 +
<br>
 +
'''To get split to work properly to separate out a username with spaces :'''<br>
 +
PS C:\scripts> $one = 'ab cd            ef'                                                                                                                                               
 +
PS C:\scripts> $two = $one -Split('  ')                                                                                                                                             
 +
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]