Manipulating a string
hello,
say have string-variable this:
$a = "\\some\\kind\\of\\text\\here\\seperated"
what easiest way reverse , change delimiters .'s insted. result be
$b = "seperated.here.text.of.kind.some"
anyone has ideas?
say have string-variable this:
$a = "\\some\\kind\\of\\text\\here\\seperated"
what easiest way reverse , change delimiters .'s insted. result be
$b = "seperated.here.text.of.kind.some"
anyone has ideas?
maybe not easiest:
$split=$a.split("\\")
for($i=$split.count+1;$i -ge 0;$i-=2){[string]$b+=($split[$i]+".")}
$b.substring(1,$b.length-3)
$split=$a.split("\\")
for($i=$split.count+1;$i -ge 0;$i-=2){[string]$b+=($split[$i]+".")}
$b.substring(1,$b.length-3)
Windows Server > Windows PowerShell
Comments
Post a Comment