4/11/2012

Convert the first letter to uppercase (C#)

To set a string with the first letter to uppercase use the bellow code

   1:  string myString = "hello world!";
   2:  myString = Regex.Replace(myString, "(?:^|\\s)\\w", new MatchEvaluator(delegate(Match m) { return m.Value.ToUpper(); }));

Categories: ,
If You Enjoyed This Post Please Take 5 Seconds To Share It.

1 comments:

This comment has been removed by a blog administrator.

Post a Comment

 
  • Followers