[java]代码库
public Map<String, Object> urlSplit(String data){
StringBuffer strbuf = new StringBuffer();
StringBuffer strbuf2 = new StringBuffer();
Map<String ,Object> map = new HashMap<String,Object>();
for(int i =0;i<data.length();i++){
if(data.substring(i,i+1).equals("=")){
for(int n=i+1;n<data.length();n++){
if(data.substring(n,n+1).equals("&")|| n ==data.length()-1){
map.put(strbuf.toString(), strbuf2);
strbuf =new StringBuffer("");
strbuf2 =new StringBuffer("");
i=n;
break;
}
strbuf2.append(data.substring(n,n+1));
}
continue;
}
strbuf.append(data.substring(i,i+1));
}
return map;
}