PowerShell can use several methods to change the case of a string such as .ToLower()
and .ToUpper()
. You can also use installed culture to capitalise the first letter of every word, though this isn’t a great option as can be hard to read. In my travels on the internet, I’ve seen some people use .ToCharArray()
, then changing [0]
but this method still has problems with mixed case and multiple sentences (yeah, you can get around it, but this is about learning other methods today)
I’ve chosen word as I could not find an example of how to do this and in the past I’ve used it to spellcheck, and it was very easy to do so. In hindsight, maybe I should have stuck to spellcheck … I’ve been reading MSDN and TechNet and manually looking over the word com object for about 6 hours. Annoyingly the end result looks really simple.
So you don’t need to do the same… click more for the function. Continue reading “I sentence you to change case! – Changing to sentence case”