A two line code in C# to remove any invalid character from input string. Very handy to clean input data from a form \\C# String CleanInput(string input) { //replace invalid character with empty string (other than alpanumeric,.,@ and -) return Regex.Replace(input,@"[^\W\.@-]",""); }
Sharing the unusual problems and solutions while developing applications using .Net. and AWS