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

How to write Pure java script Program?