c# Regex non letter characters from a string

前端 未结 2 939
失恋的感觉
失恋的感觉 2021-01-19 02:20

My terminology may be a little out here, but i am trying to strip out non letters from a string in C#, so remove dashes ampersands etc, but retain things like accented chara

2条回答
  •  南笙
    南笙 (楼主)
    2021-01-19 02:30

    string result = string.Concat(input.Where(c => Char.IsLetterOrDigit(c)));
    

提交回复
热议问题