Answers for "how to make letter to capital in c#"

C#
3

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

make string uppercase c#

string myString = "ooga booga";
string myUpperString = myString.ToUpper();
//myUpperString: "OOGA BOOGA"
Posted by: Guest on March-24-2022

Code answers related to "how to make letter to capital in c#"

C# Answers by Framework

Browse Popular Code Answers by Language