Pages

Friday, August 28, 2009

Change First Letter to Capital letter C# by Praveen P.R

// Code in C#
//Change First Letter to Capital letter

public static string titleCase(string text)
  {
  string returnTiltle;
  CultureInfo cultureInfo = Thread.CurrentThread.CurrentCulture; //Convert to title case
  TextInfo textInfo = cultureInfo.TextInfo; //Convert to title case
  return returnTiltle = textInfo.ToTitleCase(text.Trim());
  }

1 comment:

CHAITANYA KIRAN KASANI said...

Its Nice And Good...But It Has A Bug When We Want To Insert/Type A Letter Or Word In Between The Typed Word.Then The Cursor Control Is Always Jumps To End Of The Word..