Skip to content

Instantly share code, notes, and snippets.

@packetchef
Created July 22, 2020 00:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save packetchef/0517df289ceaa1609ae9f0635795a4c8 to your computer and use it in GitHub Desktop.
Save packetchef/0517df289ceaa1609ae9f0635795a4c8 to your computer and use it in GitHub Desktop.
Reverse a string in Powershell
$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