|
11 | 11 | import java.text.*;
|
12 | 12 | import java.util.*;
|
13 | 13 |
|
14 |
| -import org.apache.commons.lang.StringUtils; |
15 |
| - |
16 | 14 | import java.lang.reflect.*;
|
17 | 15 | import java.security.*;
|
18 | 16 | import java.math.BigInteger;
|
@@ -461,7 +459,7 @@ public static boolean contains(String s1, String s2)
|
461 | 459 | }
|
462 | 460 | public static String charAt(String s1, int idx)
|
463 | 461 | {
|
464 |
| - if (StringUtils.isEmpty(s1) || s1.length() < idx || idx <= 0) |
| 462 | + if (isEmpty(s1) || s1.length() < idx || idx <= 0) |
465 | 463 | return "";
|
466 | 464 | else
|
467 | 465 | return String.valueOf(s1.charAt(idx-1));
|
@@ -3220,4 +3218,34 @@ public static String getClassName(String pgmName) {
|
3220 | 3218 |
|
3221 | 3219 | return classPackage + pgmName.replace('\\', '.').trim();
|
3222 | 3220 | }
|
| 3221 | + |
| 3222 | + public static boolean isEmpty(String str) { |
| 3223 | + return str == null || str.isEmpty(); |
| 3224 | + } |
| 3225 | + |
| 3226 | + public static boolean isNotEmpty(String str) { |
| 3227 | + return str != null && !str.isEmpty(); |
| 3228 | + } |
| 3229 | + |
| 3230 | + public static String join(List<String> list, String delimiter) { |
| 3231 | + StringBuilder sb = new StringBuilder(); |
| 3232 | + for (int i = 0; i < list.size(); i++) { |
| 3233 | + sb.append(list.get(i)); |
| 3234 | + if (i < list.size() - 1) { |
| 3235 | + sb.append(delimiter); |
| 3236 | + } |
| 3237 | + } |
| 3238 | + return sb.toString(); |
| 3239 | + } |
| 3240 | + |
| 3241 | + public static String deleteWhitespace(String str) { |
| 3242 | + if (str == null) { |
| 3243 | + return null; |
| 3244 | + } |
| 3245 | + return str.replaceAll("\\s", ""); |
| 3246 | + } |
| 3247 | + |
| 3248 | + public static boolean isBlank(String str) { |
| 3249 | + return str == null || str.trim().isEmpty(); |
| 3250 | + } |
3223 | 3251 | }
|
0 commit comments