Answers for "capital char c#"

C#
0

c# capitalize first letter

string text = "john smith";

// "John smith"
string firstLetterOfString = text.Substring(0, 1).ToUpper() + text.Substring(1);

// "John Smith"
// Requires Linq! using System.Linq;
string firstLetterOfEachWord =
		string.Join(" ", text.Split(' ').ToList()
				.ConvertAll(word =>
						word.Substring(0, 1).ToUpper() + word.Substring(1)
				)
		);
Posted by: Guest on May-25-2020
1

capitalize first letter c#

using static System.Globalization.CultureInfo;
var str = CurrentCulture.TextInfo.ToTitleCase(sortColumn.ToLower().Trim());
Posted by: Guest on June-22-2021

C# Answers by Framework

Browse Popular Code Answers by Language