Created
July 22, 2020 00:02
-
-
Save packetchef/0517df289ceaa1609ae9f0635795a4c8 to your computer and use it in GitHub Desktop.
Reverse a string in Powershell
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
$forward="alphabetadeltagamma" | |
write-output $forward | |
$reverse="" | |
for($i=$forward.length; $i -ge 0; $i--) | |
{ | |
$reverse += $forward[$i] | |
} | |
write-output $reverse | |
# Output: ammagatledatebahpla |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment