LearnChineseSimplified/LearningChineseSimplified/ExtensionMethods/StringExtensions.cs

16 lines
408 B
C#

namespace LearningChineseSimplified.ExtensionMethods
{
public static class StringExtensions
{
public static string ToTitleCase(this string input)
{
char firstLetter = input[0];
firstLetter = char.ToUpper(firstLetter);
string restOfString = input.Substring(1, input.Length - 1);
return firstLetter + restOfString;
}
}
}