Net-informations.com
SiteMap  | About    

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.

  System.Globalization.CultureInfo cultureInfo = _
  new System.Globalization.CultureInfo("en-US");

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()
		{
			InitializeComponent();
		}

		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);
		}
	}
}






net-informations.com (C) 2017    Founded by raps mk
All Rights Reserved. All other trademarks are property of their respective owners.