LearnChineseSimplified/LearningChineseSimplified/ExtensionMethods/StringExtensions.cs

16 lines
408 B
C#
Raw Normal View History

2023-06-27 11:48:18 +02:00
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;
}
}
}