Skip to main content
Aug 13, 2013
/// <summary>
/// Method returns string with replaced first letter to uppercase
/// </summary>
/// <param name="text">string text for replacing</param>
/// <returns>string replaced text wiht first letter to uppercase</returns>
public string UppercaseFirst(string text)
{
  // Check for empty string.
  if (string.IsNullOrEmpty(text))
  {
    return string.Empty;
  }
   
  // Return char and concat substring.
  return char.ToUpper(text[0]) + text.Substring(1);
}