日期:2014-05-17 浏览次数:20475 次
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace ConsoleApplication3
{
class Program
{
static void Main(string[] args)
{
string name = "啊啊啊-10000元-100个";
string []arry=new string[3];
arry[0] = name.Substring(0, name.IndexOf("-"));
arry[1] = name.Substring(name.IndexOf("-") + 1, name.IndexOf("元") - name.IndexOf("-")-1);
arry[2] = name.Substring(name.LastIndexOf("-") + 1, name.IndexOf("个") - name.LastIndexOf("-") - 1);
foreach (string i in arry)
{
Console.WriteLine(i);
}
Console.ReadKey();
}
}
}