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

 
  • I'm a great believer that any tool that enhances communication has profound effects in terms of how people can learn from each other, and how they can achieve the kind of freedoms that they're interested in.

  • Followers