Answers for "string remove all non-alphanumeric characters"

C#
1

c# remove non-alphanumeric characters from string

string result = Regex.Replace(input, @"[^\w]*", String.Empty);
Posted by: Guest on July-22-2021
1

How do I remove all non alphanumeric characters from a string?

Regex rgx = new Regex("[^a-zA-Z0-9 -]");
str = rgx.Replace(str, "");
Posted by: Guest on March-25-2020

Code answers related to "string remove all non-alphanumeric characters"

C# Answers by Framework

Browse Popular Code Answers by Language