111,129
社区成员
发帖
与我相关
我的任务
分享
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;
using System.Collections;
namespace ConsoleApplication1
{
class Program
{
string[] arraySplit;
public Program()
{
string i = "12,13,14,234,23";
arraySplit = i.Split(new string[1] { "," }, StringSplitOptions.RemoveEmptyEntries);
//arraySplit变量里面就存放了你需要的字符串
//Display the split string in Console.
for (int j = 0; j < arraySplit.Length; j++)
{
Console.WriteLine("{0}:{1}", j, arraySplit[j]);
}
}
static void Main()
{
Program p1 = new Program();
Console.ReadLine();
}
}
}

string i ="12,13,14,234,23";
string[] tem = i.split(',');
for(int j=0;i<tem.length;j++)
//do what you want
string a = "'12','13','14','234','23’";//这样?
//还是
string b = "12','13','14','234','23"; //这样?