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

Popular posts from this blog

Customize User's Profile in ASP.NET Identity System

Migrating database from ASP.NET Identity to ASP.NET Core Identity