Posted by : Jebastin Tuesday 7 January 2014

The following C# code is used to convert the first character of a string into upper case.
  1. static string UppercaseFirst(string s)
  2. {
  3. // Check for empty string.
  4. if (string.IsNullOrEmpty(s))
  5. {
  6.     return string.Empty;
  7. }
  8. // Return char and concat substring.
  9. return char.ToUpper(s[0]) + s.Substring(1);
  10. }

Leave a Reply

Subscribe to Posts | Subscribe to Comments

Link To This Post/Page

Spread The Word

Add this button to your blog:
JJ Technology Solutions

Blog Archive

Trackers

eXTReMe Tracker
facebook

- Copyright © JJ Technology Solutions - Powered by Source Code Solutions -