-
-
Save bilz346/9c3b90c6b0cc26aa36af to your computer and use it in GitHub Desktop.
Format-Word
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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