blob: e672785e37ec2c15a9d6d160649e718632ea9a7b (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
package org.zwobble.mammoth.internal.util;
import java.util.List;
import java.util.regex.Pattern;
import static java.util.Arrays.asList;
public class Strings {
public static String trimLeft(String value, char character) {
int index = 0;
while (index < value.length() && value.charAt(index) == character) {
index++;
}
return value.substring(index);
}
public static boolean isNullOrEmpty(String value) {
return value == null || value.isEmpty();
}
public static boolean startsWithIgnoreCase(String value, String prefix) {
return value.regionMatches(true, 0, prefix, 0, prefix.length());
}
public static List<String> split(String value, String separator) {
return asList(value.split(Pattern.quote(separator)));
}
}
|