-
Notifications
You must be signed in to change notification settings - Fork 2.3k
Open
Labels
Description
APIJSON/APIJSONORM/src/main/java/apijson/StringUtil.java
Lines 121 to 132 in 297c251
| String s = ""; | |
| if (array != null) { | |
| if (split == null) { | |
| split = ","; | |
| } | |
| for (int i = 0; i < array.length; i++) { | |
| if (ignoreEmptyItem && isEmpty(array[i], true)) { | |
| continue; | |
| } | |
| s += ((i > 0 ? split : "") + array[i]); | |
| } | |
| } |
APIJSON/APIJSONORM/src/main/java/apijson/StringUtil.java
Lines 543 to 554 in 297c251
| String numberString = ""; | |
| String single; | |
| for (int i = 0; i < s.length(); i++) { | |
| single = s.substring(i, i + 1); | |
| if (isNumer(single)) { | |
| numberString += single; | |
| } else { | |
| if (onlyStart) { | |
| return numberString; | |
| } | |
| } | |
| } |
APIJSON/APIJSONORM/src/main/java/apijson/StringUtil.java
Lines 646 to 653 in 297c251
| String correctPrice = ""; | |
| String s; | |
| for (int i = 0; i < price.length(); i++) { | |
| s = price.substring(i, i + 1); | |
| if (".".equals(s) || isNumer(s)) { | |
| correctPrice += s; | |
| } | |
| } |
建议在循环中使用StringBuilder拼接字符串