Thursday, February 28, 2008

Sudden Death Challenge: Event 6

 

$words = (cat c:\scripts\lettercase.txt).split(" ") | foreach {
    if($_ -match '\d+') {
        $_= [int]$_ -1111; $_
    } else {
        $_= $_[0].toString().toUpper()+$_.substring(1).toLower(); $_
    }
}

[string]::join(" ",$words)

 

# result

The 2008 Winter Scripting Games!

No comments: