62,621
社区成员
发帖
与我相关
我的任务
分享
String desc="门诊号:000000003 姓名:顾晓剑 性别:男 出生年月:1983-04-17";
String[] first = desc.split(" ");
Map map = new HashMap();
for (int i = 0; i < first.length; i++) {
String[] strs = first[i].split(":");
map.put(strs[0],strs[1]);
}
System.out.println(map.toString());
{"desc","门诊号: 000000003
姓名:顾晓剑 性别:男 出生年月:1983-04-17“
}