It’s Friday and I’m following Jeffery Hicks idea to have fun with PowerShell. Well, here’s the mistery of Redrum solved one more time. Some time ago, I remember seen some code for reversing a string of characters. Well, here’s the one-liner I use to solve the puzzle:
[sourcecode language=”powershell”]
$str = "Redrum";
[System.Array]::Reverse(([Array]$RevStr = $str.ToCharArray()));
foreach($chr in $RevStr){ $mistery += $chr }
$mistery;
[/sourcecode]
That’s all for now…. Have fun with PowerShell!