以下为演示代码,未经过测试int[] a =....;
string buffer buf = new string buffer();
for(int I = ;我& lta .长度;i++)
buf . append(integer . tostring(a[I]))。追加(',');
反过来就是
int count = ;
String s = buf . tostring();
for(int I = ;我& lts.length()。i++)
if( s.charAt(i)== ',')count++;
int[]b = new int[count];
int p1=,p2 = ;
int I = ;while((p2=s.indexOf(','))& gt= ){
b[I]= integer . parse int(s . substring(P1,p2));
p1 = p2
}