Format-Word
Function Format-Word | |
{ | |
[CmdletBinding()] | |
Param([parameter(Mandatory=$True,ValueFromPipeline=$True)] [String]$String) | |
Process | |
{ | |
ForEach ($Word in $String.split()) | |
{ | |
$First = [string]$Word[0] | |
$Rest = $Word.TrimStart($First) | |
$FormattedWord += "$($First.ToUpper() + $Rest.ToLower()) " | |
} | |
$FormattedWord | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment