2015年8月26日 星期三

[C#] 移除字串中非數字的字元,只保留數字。

using System.Text.RegularExpressions;
string testStr;
testStr = Regex.Replace(testStr, "[^0-9]", "");

沒有留言: