1. convert a string to Proper Case public static string ConvertToProperCase(string text) { System.Globalization.TextInfo TI = new System.Globalization.CultureInfo("en-US",false).TextInfo; return TI.ToTitleCase(text); } eg: "rOshaN punnIlaTH mOHAmmed" --> "Roshan Punnilath Mohammed" 2. To validate that a string is a valid date public static bool IsDate(string text) { try { DateTime.Parse(text); return true; } catch { return false; } } 3. To remove HTMl tags from a string public static string RemoveHTML(string desc) { return Regex.Replace(desc,@" ", string.Empty); } 4. To read a file public static string ReadFile(string sFile) { StreamReader SR; string sText; SR = File.OpenText(sFile); sText = SR.ReadToEnd(); SR.Close(); return(sText); }
I'll write what I think, I'll share what I like. If you do not like, I'm Sorry