赞
踩
一、数字
Regex.Replace(str, @"[^0-9]+", "")
二、小写字母
Regex.Replace(str, @"[^a-z]+", "")
参考文档:C#正则表达式提取数字或大小写字母_yyq3871584的博客-CSDN博客
三、提取大小写字母数字,并判断是否是回文数
Regex rgx = new Regex("[^A-Za-z0-9]");
string temp = rgx.Replace(s.ToLower(), "").Trim().Replace(" ","");
string temp1 = new string(temp.ToCharArray().Reverse().ToArray());
return temp == temp1;
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
赞
踩
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。