I have a sequence of strings which I get in following format:
As you can see middle section of the string is not consistent case (for Corolloa, it is listed as toyota). I need to change above as follows:
I want to make middle section of the string to be Title Case.
I am using following
static TextInfo textInfo = new CultureInfo( "en-US" ).TextInfo;
and using .ToTitleCase but the issue with TitleCase is if the string is in UPPERCASE, it would not change to TitleCase. Do we know how to handle a case when string is uppercase.
You can use .ToTitleCase()
var myString = "Project1:toyota:Corolla";
TextInfo textInfo = new CultureInfo( "en-US" ).TextInfo;
myString = textInfo.ToTitleCase(myString);