String Title Case

The String Class is a sealed class , so you cannot inherit another class from the String class. ToTitleCase converts the first character of a word to uppercase and the rest of the characters to lowercase.

A neutral culture is specified by only the two-letter lowercase language code. For example, "fr" specifies the neutral culture for French, and "de" specifies the neutral culture for German.

The CultureInfo class renders culture-specific information, such as the associated language, sublanguage, country/region, calendar, and cultural conventions. The following C# source code shows how to convert a string to Title Case.

using System;
using System.Windows.Forms;

namespace WindowsFormsApplication1
	public partial class Form1 : Form
		public Form1()

		private void button1_Click(object sender, EventArgs e)
			string _str = null;
			System.Globalization.CultureInfo cultureInfo = new System.Globalization.CultureInfo("en-US");
			_str = cultureInfo.TextInfo.ToTitleCase("make first letter capital");
			MessageBox.Show (_str);
} (C) 2022    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.
SiteMap  | Terms  | About