asp.net中在一个字符串中判断包含在里面的数字位置 asp.net中在一个字符串中判断包含在里面的数字位置。例如abcdef123der,怎么才能知道这个字符串中数字在那个位置。ASP.NET 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string txt = "abcdef123der"; Console.WriteLine("数字的位置是:{0}", txt.IndexOf(Regex.Match(txt, @"\d+").Groups[0].Value)); string txt = "abcdef123der";for (int i = 0; i < txt.Length; i++){ int parse; if (int.TryParse(txt[i].ToString(),out parse)) { Console.Write("位置:" + i.ToString()); break; } } int index = Regex.Match("abcdef123der", "\\d").Index; ajax里的ModalPopupExtender例子 问个问题,是不是html源代码里有下面这行代码,就表示使用了viewstate? 请教一个,在线等 DataGrid模板列问题 为什么没有人有能回答不执行Page_Load事件的解决方法 求Visual Studio.NET操作的电子书? 一个存储过程中事务问题! 一个很见的的入门问题!谢谢 请教:怎样使ImageButton先执行javascript函数后调用后台的click函数? .net mvc4 AuthorizationAttribute类 求大神 在线等 关于控件中调用js方法时出错 关于blockui的拓展功能
Console.WriteLine("数字的位置是:{0}", txt.IndexOf(Regex.Match(txt, @"\d+").Groups[0].Value));
string txt = "abcdef123der";
for (int i = 0; i < txt.Length; i++)
{
int parse;
if (int.TryParse(txt[i].ToString(),out parse))
{
Console.Write("位置:" + i.ToString());
break;
}
}