This is a simple string extension for upper casing the first letter of a string, the code originally came from here.

public static class StringExtensions
{
	public static string FirstLetterToUpperCase(this string s)
	{
		if (string.IsNullOrEmpty(s))
			throw new ArgumentException("There is no first letter");

		char[] a = s.ToCharArray();
		a[0] = char.ToUpper(a[0]);
		return new string(a);
	}
}

0 Comments

Leave a Reply

Avatar placeholder

Your email address will not be published.