jessewth's blog
2008/09/04
C# Remove Chinese Char
string
txtBody =
"中文chinese"
;
txtBody = Regex.Replace(txtBody ,
"[\u4E00-\u9FFF]"
,
""
); // 移除中文
結果
---------------
txtBody : "chinese"
會用到的這regex的原因為是為css裡中文註解,搞到utf-8的網頁變亂碼,索性把css內的所有中文給過濾移除(暴力)。
‹
›
首頁
查看網路版