买配件的[000010] 张华100% 这两种字符串怎么截取? 我想留下汉字 求帮助
------解决方案--------------------------------------------------------
string str = "买配件的[000010] 张华100%";
str = Regex.Replace(str, @"[^\u4e00-\u9fa5]", "");
------解决方案--------------------------------------------------------
- C# code
string s1 = "买配件的[000010] 张华100%";string s2 = string.Concat(s1.Where(p => p > 0x4e00 && p < 0x9fa5));
------解决方案--------------------------------------------------------
string [] strs = "a买配件的[000010] 张华100% ".Split(']');
string 买配件 = Regex.Replace(strs[0], @"[^\u4e00-\u9fa5]|\s", "");
string 张化 = Regex.Replace(strs[1], @"[^\u4e00-\u9fa5]|\s", "");
Response.Write(买配件+张化);
------解决方案--------------------------------------------------------
string str = Regex.Replace(str1, @"[^\u4e00-\u9fa5]", "")+Regex.Replace(str2, @"[^\u4e00-\u9fa5]", "");