public class SPLIT extends NamedWarpScriptFunction implements WarpScriptStackFunction
The limit parameter controls the number of times the pattern is applied and therefore affects the length of the resulting array. If the limit n is greater than zero then the pattern will be applied at most n - 1 times, the array's length will be no greater than n, and the array's last entry will contain all input beyond the last matched delimiter.
| Constructor and Description |
|---|
SPLIT(java.lang.String name) |
| Modifier and Type | Method and Description |
|---|---|
java.lang.Object |
apply(WarpScriptStack stack) |
static java.util.List<java.lang.String> |
split(java.lang.String input,
char delim,
int limit)
Split a string using a delimiter and returning a List of "limit" maximum length.
|
getName, refSnapshot, setName, toStringpublic java.lang.Object apply(WarpScriptStack stack) throws WarpScriptException
apply in interface WarpScriptStackFunctionWarpScriptExceptionpublic static java.util.List<java.lang.String> split(java.lang.String input,
char delim,
int limit)
input - The String instance to be split.delim - The delimiter to use for the split.limit - The returned List maximum size. For limit <= 0 the List contains the input.