Search This Blog

Showing posts with label TextInfo. Show all posts
Showing posts with label TextInfo. Show all posts

Sunday, April 30, 2017

.NET built in function to convert string to into Title Case

Although a simple task, I was exposed today (here) to a built in function in the framework that does the job.


string title = "war and peace";

TextInfo textInfo = new CultureInfo("en-US", false).TextInfo;
title = textInfo.ToTitleCase(title); //War And Peace