Answers for "public static list remove special characters c#"

C#
1

c# string remove special characters

public static string RemoveSpecialCharacters(this string str) {
   StringBuilder sb = new StringBuilder();
   foreach (char c in str) {
      if ((c >= '0' && c <= '9') || (c >= 'A' && c <= 'Z') || (c >= 'a' && c <= 'z') || c == '.' || c == '_') {
         sb.Append(c);
      }
   }
   return sb.ToString();
}
Posted by: Guest on May-20-2020

Code answers related to "public static list remove special characters c#"

C# Answers by Framework

Browse Popular Code Answers by Language