日期:2014-05-17  浏览次数:20411 次

一个字符串截取问题,在线等,有正确答应就结贴
120*110
把120,1102个整数取出来
求完整的过程

------解决方案--------------------
啥意思??
"120*110".Split("*")[0]、"120*110".Split("*")[1]
???
------解决方案--------------------
C# code

            int[] ary = System.Text.RegularExpressions.Regex.Matches("120*110", "\\d+").Cast<Match>().Select(t =>Convert.ToInt32( t.Value)).ToArray();

------解决方案--------------------
C# code

            string source = "120*110";
            Regex reg = new Regex(@"(\d+)\*(\d+)");
            Match mm = reg.Match(source);
            MessageBox.Show(mm.Groups[1].Value + ":" + mm.Groups[2].Value);