按照;截取
String[] all = Url.split(";");
String oneStr = all[0];
String twoStr = all[1];
截取字符=之后的内容
String str = "sdfsdfsdf=erwerwer";
String oneStr = str.substring(str.indexOf("=") + 1);
输出erwerwer
截取字符=之前的内容
String str = "sdfsdfsdf=erwerwer";
String oneStr = str.substring(0,str.indexOf("=") );
输出sdfsdfsdf
按照逗号分割
String str = "qwe,asd, sdf,zxc";
String[] oneStr = str.split(",");
输出qwe
输出asd
输出sdf
输出zxc
网友评论