| | |
| | | import com.qianwen.core.tool.utils.StringPool; |
| | | import com.qianwen.core.tool.utils.StringUtil; |
| | | |
| | | /* loaded from: blade-core-tool-9.3.0.0-SNAPSHOT.jar:org/springblade/core/tool/support/StrSpliter.class */ |
| | | |
| | | public class StrSpliter { |
| | | public static List<String> splitPath(String str) { |
| | | return splitPath(str, 0); |
| | |
| | | |
| | | public static List<String> split(String str, char separator, int limit, boolean isTrim, boolean ignoreEmpty, boolean ignoreCase) { |
| | | if (StringUtil.isEmpty(str)) { |
| | | return new ArrayList(0); |
| | | return new ArrayList<>(0); |
| | | } |
| | | if (limit == 1) { |
| | | return addToList(new ArrayList(1), str, isTrim, ignoreEmpty); |
| | | return addToList(new ArrayList<>(1), str, isTrim, ignoreEmpty); |
| | | } |
| | | ArrayList<String> list = new ArrayList<>(limit > 0 ? limit : 16); |
| | | int len = str.length(); |
| | |
| | | |
| | | public static List<String> split(String str, String separator, int limit, boolean isTrim, boolean ignoreEmpty, boolean ignoreCase) { |
| | | if (StringUtil.isEmpty(str)) { |
| | | return new ArrayList(0); |
| | | return new ArrayList<>(0); |
| | | } |
| | | if (limit == 1) { |
| | | return addToList(new ArrayList(1), str, isTrim, ignoreEmpty); |
| | | return addToList(new ArrayList<>(1), str, isTrim, ignoreEmpty); |
| | | } |
| | | if (StringUtil.isEmpty(separator)) { |
| | | return split(str, limit); |
| | |
| | | |
| | | public static List<String> split(String str, int limit) { |
| | | if (StringUtil.isEmpty(str)) { |
| | | return new ArrayList(0); |
| | | return new ArrayList<>(0); |
| | | } |
| | | if (limit == 1) { |
| | | return addToList(new ArrayList(1), str, true, true); |
| | | return addToList(new ArrayList<>(1), str, true, true); |
| | | } |
| | | ArrayList<String> list = new ArrayList<>(); |
| | | int len = str.length(); |
| | |
| | | |
| | | public static List<String> split(String str, Pattern separatorPattern, int limit, boolean isTrim, boolean ignoreEmpty) { |
| | | if (StringUtil.isEmpty(str)) { |
| | | return new ArrayList(0); |
| | | return new ArrayList<>(0); |
| | | } |
| | | if (limit == 1) { |
| | | return addToList(new ArrayList(1), str, isTrim, ignoreEmpty); |
| | | return addToList(new ArrayList<>(1), str, isTrim, ignoreEmpty); |
| | | } |
| | | if (null == separatorPattern) { |
| | | return split(str, limit); |