LearnChineseSimplified/CCharLearn/ExtensionMethods/StringExtensions.cs

16 lines
393 B
C#
Raw Normal View History

2023-07-07 19:41:56 +02:00
namespace CCharLearn.ExtensionMethods
2023-06-27 11:48:18 +02:00
{
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;
}
}
}