Tags : string
Use the ToUpper method of the char object in combination with the string's index to capitalize the first letter. For the remainder of the string simply use the Substring method to return the string beyond the first character.
string inputStr = "america";
string capitalizedStr = char.ToUpper(inputStr[0]) + inputStr.Substring(1);
blog comments powered by Disqus