Commit 41eaece0 by huzhenkun

修改比较器

parent 244c935c
...@@ -54,8 +54,8 @@ public class StringComparator implements Comparator<String> { ...@@ -54,8 +54,8 @@ public class StringComparator implements Comparator<String> {
boolean isCh1Num = ch1 >= '0' && ch1 <= '9'; boolean isCh1Num = ch1 >= '0' && ch1 <= '9';
boolean isCh2Num = ch2 >= '0' && ch2 <= '9'; boolean isCh2Num = ch2 >= '0' && ch2 <= '9';
if (isCh1Num && isCh2Num) { if (isCh1Num && isCh2Num) {
long i1 = getNumber(str1.substring(i)); long i1 = getNumber(str1.substring(i,i+1));
long i2 = getNumber(str2.substring(i)); long i2 = getNumber(str2.substring(i,i+1));
if (i1 != i2) { if (i1 != i2) {
return i1 > i2 ? 1 : -1; return i1 > i2 ? 1 : -1;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment