下面代码显示如何从带数字字符串中输出数字字符。
public static string StripNumbers(string Value) {
StringBuilder stringbuilder = new StringBuilder();
if(Value != string.Empty || Value != null) {
foreach(char a in Value) {
if(char.IsDigit(a))
stringbuilder .Append(a);
}
return stringbuilder .ToString();
} else {
return string.Empty;
}
}