[AppleScript] 纯文本查看 复制代码
public static void main(String[] args) {
String string = "1.2,3.4,5.6,7.8,5.56,44.55";
String [] num = string.split(",");
Map<Object , Object> map = new LinkedHashMap<>();
for (int i = 0; i < num.length; i++) {
String [] arr = num.split("\\.");
map.put(arr[0], arr[1]);
}
Set <Object> set = map.keySet();
for (Object object : set) {
System.out.println(object);
}
Collection<Object> collection = map.values();
for (Object object : collection) {
System.out.println(object);
}
}
}