解决方案 »
- java中如何调用这样的DLL接口
- 求个算法
- 大家看下这个表?如何实现
- Flex中如何给DateField的DateChooser设置背景颜色???
- 求助: 关于j2ee"容器"概念的问题。
- WebService传递Object
- ssh工程加如Acegi后出现的 ActionServlet 取路径取不到的问题!!!
- 50分求1个hibernate异常解决方法
- 『急』关于xerces的问题
- 怎么将INTERFACE转化成IDL文件,如果没有自己写一个
- jsp问题: The server encountered an internal error () that prevented it from fulfil
- 【求助】求大神教我写一个SQL语句,在线急等!!!!
List<String> sIdList = new ArrayList<String>();
List<String> gIdList = new ArrayList<String>();
for(var i=0;i<temp.length;i++){
String[] temp1=temp[i].split("*");
sIdList.add(temp1[0]);
gIdList.add(temp1[1]);
}
//两个集合成对出现,不用客气。你到问题描述的不是十分清楚哦
sId*gId_gId_gId_gId,
sId*gId
..........
"
例如 10000*1_2,
10001*3_4_5_6,
10002*7,
......................截取后的是 sid gid
String demo = "sId1*gId1_gId2,sId2*gId1";
String[] splitedSid = demo.split(",");
Map<String, String[]> map = new HashMap<String, String[]>();
for (int i = 0; i < splitedSid.length; i++) {
String gid = splitedSid[i].split("\\*")[0];
String[] splitedGid = splitedSid[i].split("\\*")[1].split("_");
map.put(gid, splitedGid);
}
Matcher m = Pattern.compile("(.*?),").matcher(s);
while(m.find()){
System.out.println(m.group(1).split("\\*")[0]+"--->"+m.group(1).split("\\*")[1]);
}