Convert string in lowercase and avoid spaces in c#

 string txt = "                   i am a string  Am I U                                   ";//User entry
             txt=txt.Trim();          //avoid first and lost spaces
            txt = txt.ToLower();//convert all sentence in lower case
            txt = txt.Replace(" ", "");// avoid spaces

Comments

Popular posts from this blog

Wcf interview

Uses of all page notations in .Net like ASPX,ASMX,ASAX .................... in asp.net

checkbox all for radioButtonList Control Inside Gridview in Asp.Net C#