怎么提取这样的字符串12*36 怎么提取这样的字符串12*36*2分别提取 12 和 36 还有 2出来 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 string aa[] = string.spilt(new char['*']) String str = "12*36*2";Regex objRegex = new Regex(@"(?<First>\d+)\*(?<Second>\d+)\*(?<Third>\d+)");MatchCollection objCollection = objRegex.Matches(str);for (int i = 0; i < objCollection.Count; i++){ Response.Write( "第一个乘数:" + objCollection[i].Groups["First"].Value + "第二个乘数:" + objCollection[i].Groups["Second"].Value + "第三个乘数:" + objCollection[i].Groups["Third"].Value + "<br/>");}//结果为://第一个乘数:12第二个乘数:36第三个乘数:2 C# 关于xml加密出现的问题 如果是winfrom有一个功能要输入html代码(包括了图片),怎么实现呢? 能不能在应用程序的解决方案里为用户控件生成dll? 如何弹出类似于这样的对话框? DataGrid 一直改不好的问题,请高手帮忙啊!!! 奇怪的SWITCH 如何去掉滚动条 天津程序員的悲惨现状... 关于跨AppDomain传递Form的问题 哪位大虾能提供一些有关OR-MAP的资料!!多谢!!! SQL问题,知道的说下,谢谢。 远程连接数据库
Regex objRegex = new Regex(@"(?<First>\d+)\*(?<Second>\d+)\*(?<Third>\d+)");MatchCollection objCollection = objRegex.Matches(str);
for (int i = 0; i < objCollection.Count; i++)
{
Response.Write(
"第一个乘数:" + objCollection[i].Groups["First"].Value +
"第二个乘数:" + objCollection[i].Groups["Second"].Value +
"第三个乘数:" + objCollection[i].Groups["Third"].Value + "<br/>");
}//结果为:
//第一个乘数:12第二个乘数:36第三个乘数:2