日期:2014-05-20 浏览次数:20892 次
public class SplitS
{
public static void main(String[] args)
{
String text = "a=1&&b=2&&c=3&&d=4";
String[] sss = text.split("&&");
String[] r1 = new String[sss.length];
String[] r2 = new String[sss.length];
for(int i = 0; i<sss.length; i++)
{
String[] temp = sss[i].split("=");
r1[i] = temp[0];
r2[i] = temp[1];
}
for (int i =0; i<sss.length; i++)
{
System.out.println(r1[i]+" "+ r2[i]);
}
}
}