Scripting Games 2008 Sudden Death Challenge Event 6
Altought the -replace operator does not support scriptblocks yet ( We keep on begging ;-) ) ,
the Switch -regex was a nice alternative in this case :
([string[]][char[]](gc c:\scripts\Lettercase.txt) |% {
Switch -regex -casesensitive ($_) {
'[A-Z]' {$_.tolower()}
'[a-z]' {$_.toUpper()}
'\d' {[int]$_ - 1}
default {$_}
}
}) -join ''
Enjoy,
Greetings /\/\o\/\/