public static void main(String[] args) {
String aa = "1,2,3";
String[] bb = aa.split(",");
for (int i = 0; i < bb.length; i++) {
Integer cc = Integer.parseInt(bb[i]);
System.out.println(cc);
}
}
输出值为1 2 3
public static void main(String[] args) {
String aa = "1,2,3";
String[] bb = aa.split(",");
for (int i = 0; i < bb.length; i++) {
Integer cc = Integer.parseInt(bb[i]);
System.out.println(cc);
}
}
输出值为1 2 3
本文标题:Java中split和string[] 转化为integer[]
本文链接:https://www.haomeiwen.com/subject/chuwjftx.html
网友评论