String str1 = "1.4.3";
String str2 = "1,4,4";
String[] Step3 ;
System.out.println(str2);
String[] Step1 = new String[]{};
String[] Step2 = new String[]{};
if (Step1.length >= Step2.length) {
Step3 = new String[Step1.length];
Step3 = Step2;
}else {
Step3 = new String[Step2.length];
Step3 = Step1;
}
Step1 = str1.split("\\.");
Step2 = str2.split(",");
for (int i = 0; i < Step1.length; i++) {
System.out.println("++++"+Step1[i]);
}
for (int i = 0; i < Step2.length; i++) {
System.out.println("0000"+Step2[i]);
String str2 = "1,4,4";
String[] Step3 ;
System.out.println(str2);
String[] Step1 = new String[]{};
String[] Step2 = new String[]{};
if (Step1.length >= Step2.length) {
Step3 = new String[Step1.length];
Step3 = Step2;
}else {
Step3 = new String[Step2.length];
Step3 = Step1;
}
Step1 = str1.split("\\.");
Step2 = str2.split(",");
for (int i = 0; i < Step1.length; i++) {
System.out.println("++++"+Step1[i]);
}
for (int i = 0; i < Step2.length; i++) {
System.out.println("0000"+Step2[i]);
}
注:使用"\\."可以用来剪切Android中"." ,获者将"."转化为其他字符在剪切