How to remove control chars from UTF8 string

后端 未结 2 1212
爱一瞬间的悲伤
爱一瞬间的悲伤 2021-02-10 12:29

i have a VB.NET program that handles the content of documents. The programm handles high volumes of documents as \"batch\"(>2Million documents;total 1TB volume) Some of this doc

2条回答
  •  臣服心动
    2021-02-10 13:08

    Try

    resultString = Regex.Replace(subjectString, "\p{C}+", "");
    

    This will remove all "other" Unicode characters (control, format, private use, surrogate, and unassigned) from your string.

提交回复
热议问题