Class Splitter
-
- All Implemented Interfaces:
public class Splitter- Since:
2023-06-13
trydofor
-
-
Constructor Summary
Constructors Constructor Description Splitter()
-
Method Summary
Modifier and Type Method Description static List<String>list(@NotNull() String sep, String str)split string by separator static List<String>list(@NotNull() String sep, String str, int max)split string by separator static <T> List<T>list(@NotNull() String sep, String str, @NotNull() Function<String, T> fun)split string by separator and convert to T static <T> List<T>list(@NotNull() String sep, String str, int max, @NotNull() Function<String, T> fun)split string by separator and convert to T static intcount(@NotNull() String sep, String str)count items split by separator 0 - if str is empty 1 - if str does not contain sep n+1 - if str contains n sep-
-
Method Detail
-
list
@NotNull() static List<String> list(@NotNull() String sep, String str)
split string by separator
- Parameters:
sep- separatorstr- string- Returns:
list of string
-
list
@NotNull() static List<String> list(@NotNull() String sep, String str, int max)
split string by separator
- Parameters:
sep- separatorstr- stringmax- max items- Returns:
list of string
-
list
@NotNull() static <T> List<T> list(@NotNull() String sep, String str, @NotNull() Function<String, T> fun)
split string by separator and convert to T
- Parameters:
sep- separatorstr- stringfun- convert string to T- Returns:
list of T
-
list
@NotNull() static <T> List<T> list(@NotNull() String sep, String str, int max, @NotNull() Function<String, T> fun)
split string by separator and convert to T
- Parameters:
sep- separatorstr- stringmax- max itemsfun- convert string to T- Returns:
list of T
-
-
-
-