Created
October 9, 2016 10:52
-
-
Save exchange12rocks/e175cba09f4c1b1bd06debc83e8eccb7 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
param ( | |
[Parameter(Mandatory=$True)] | |
[System.Array]$StringList, | |
[Parameter(Mandatory=$False)] | |
[System.Array]$Delimiter = '.' | |
) | |
$StringListReversed = @() | |
foreach ($String in $StringList) { | |
$StringSplitted = $String.Split($Delimiter) | |
$Counter = $StringSplitted.Count | |
$StringReversed = '' | |
while ($Counter -gt 0) { | |
$StringReversed += $StringSplitted[$Counter-1] | |
$Counter = $Counter-1 | |
if ($Counter -gt 0) { | |
$StringReversed += $Delimiter | |
} | |
} | |
$StringListReversed += $StringReversed | |
} | |
return $StringListReversed |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment