Regex to remove all special characters from string?

前端 未结 9 1371
谎友^
谎友^ 2020-12-04 15:15

I\'m completely incapable of regular expressions, and so I need some help with a problem that I think would best be solved by using regular expressions.

I have list

9条回答
  •  粉色の甜心
    2020-12-04 16:02

    tmp = Regex.Replace(n, @"\W+", "");
    

    \w matches letters, digits, and underscores, \W is the negated version.

提交回复
热议问题