The following function in .Net C# changes the string to its equivalent Title Case.
public static string ToTitleCase(string mText)
{
string rText = "";
try
{
System.Globalization.CultureInfo cultureInfo =
System.Threading.Thread.CurrentThread.CurrentCulture;
System.Globalization.TextInfo TextInfo = cultureInfo.TextInfo;
rText = TextInfo.ToTitleCase(mText);
}
catch
{
rText = mText;
}
return rText;
}
its not working if the input string in uppercase is there any solution Thanks in advance
@madhu Hate to stat the obvious but why not just call .ToLower() on it first? :)
@madhu Hate to state the obvious but why not just call .ToLower() on it first? :)
@NickG ... Hate to state the obvious, but stat is spelled state :P
You should add .ToLower() to the body of the function in the post
Way too long... public static string ToTitleCase(this string aString) { try { return System.Threading.Thread.CurrentThread.CurrentCulture.TextInfo.ToTitleCase(aString); } catch { return aString; } }
Thanks for your guides. it's really helpful. and i'm studying [URL="http://www.keepautomation.com/guide/csharp_barcode_generator.html"]C# Barcode Generation [/URL]too. that's also helpful. thanks both of you!
Thanks for your guides. it's really helpful. and i'm studying C# Barcode Generation. that's also helpful. http://www.keepautomation.com/guide/csharp_barcode_generator.html
Thanks for your guides. it's really helpful. and i'm studying C# Barcode Generation. that's also helpful. http://www.keepautomation.com/guide/csharp_barcode_generator.html