Convert To Proper Case in C#
Introduction
Here is a method which will convert your string in Proper Case, you just need to pass the string to this method and method will return the Proper Case string as a result.
public string ConvertToProperCase(string str)
{
string formattedStr = null;
if (str == null)
{
formattedStr = new System.Globalization.CultureInfo("en").TextInfo.ToTitleCase(str.ToLower());
}
return formattedStr;
}
Comments
Post a Comment