Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # "Dev History Ripper/text/Capitalize-LetterSeries.ps1"
- function Capitalize-LetterSeries {
- param (
- [Parameter(Mandatory = $true)]
- [string]$InputString
- )
- # Replace each series of letters with the capitalized version
- $result = $InputString -replace '([A-Za-z]+)', {
- $matches[1].Substring(0, 1).ToUpper() + $matches[1].Substring(1).ToLower()
- }
- return $result
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement