Capitalize the First Letter in PowerShell (Plus Uppercase, Lowercase and Title Case)
To capitalize the first letter in PowerShell, uppercase the first character and add the rest of the string back: $text.Substring(0, 1).ToUpper() + $text.Substring(1). For the whole string, call .ToUpper() or .ToLower(), and for every word, use ToTitleCase: Output: None of these change $city itself. Each one returns a new string, so save the result in … Read more