The following code in c# creates an extension method and converts the First letter to uppercase along
with each letter after space.
namespace ExtensionMethods
{
public static class clsUpperFirstLetter
{
public static string UpperCase(this string text)
{
text=System.Globalization.CultureInfo.CurrentCulture.TextInfo.ToTitleCase(text.ToLower());
return text;
}
}
}
The following code calls the above extension method
using ExtensionMethods;
namespace Project1
{
private void Button1_Click(object sender, EventArgs e)
{
labelControl1.Text = textEdit1.Text.UpperCase();
}
}
For further question please mail: brainstormiert@gmail.com