Convert A String To Title Case

Just a tip #9

Converting a string to upper and lower cases are possible with the string object using the dot notation, but not sure why title case is not directly supported yet with the string object in PowerShell, however there are a couple of ways to achieve the same…

$Text = 'kiran patnayakuni'

# Using PowerShell
(Get-Culture).TextInfo.ToTitleCase($Text)

#Using .Net
[cultureinfo]::CurrentCulture.TextInfo.ToTitleCase($Text)

Share it on     |   |   |   | 
  Prev:  

Overload Definitions of a Method

  :Next  

Get All The aliases By CmdLet

comments powered by Disqus