The following function in .Net C# changes the string to its equivalent Title Case.
public static string ToTitleCase(string mText)
{
string rText = "";
try
{
System.Globalization.CultureInfo cultureInfo =
System.Threading.Thread.CurrentThread.CurrentCulture;
System.Globalization.TextInfo TextInfo = cultureInfo.TextInfo;
rText = TextInfo.ToTitleCase(mText);
}
catch
{
rText = mText;
}
return rText;
}
its not working if the input string in uppercase is there any solution Thanks in advance
@madhu Hate to stat the obvious but why not just call .ToLower() on it first? :)
@madhu Hate to state the obvious but why not just call .ToLower() on it first? :)
@NickG ... Hate to state the obvious, but stat is spelled state :P
You should add .ToLower() to the body of the function in the post