日期:2014-05-17 浏览次数:20612 次
string camId="300,50,65,52"; long[] campaignId=new long[]{300,50,65,52};
string camId = "300,50,65,52"; long[] campaignId = camId.Split(new char[] { ',',','}).Select(a=>long.Parse(a)).ToArray(); /* [0] 300 long [1] 50 long [2] 65 long [3] 52 long */
------解决方案--------------------
string camId="300,50,65,52";
long[] campaignId=camId.ToCharArray();
------解决方案--------------------
这是赋给string[]数组的方法
string camId = "300,50,65,52"; string[] campaignId = null; campaignId = camId.Split(',');