Skip to content

Instantly share code, notes, and snippets.

@exchange12rocks
Created October 9, 2016 10:52
Show Gist options
  • Save exchange12rocks/e175cba09f4c1b1bd06debc83e8eccb7 to your computer and use it in GitHub Desktop.
Save exchange12rocks/e175cba09f4c1b1bd06debc83e8eccb7 to your computer and use it in GitHub Desktop.
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