PowerShell String Reverse Function

Strangely, PowerShell does not include a string reverse function.  After some googling, I wrote a simple reverse function based on regular expressions:

1
2
3
4
function Reverse-String ($inputstring)
{
    -join[regex]::Matches($inputstring,".",'RightToLeft')
}

This entry was posted in Powershell. Bookmark the permalink.