#### StringSplit

##### StringSplit(inString, delimiterString, count, compare)

This function takes a String that contains a number of substrings, breaks it up into a specified number of substrings and returns an array containing the substrings.

Overloads

- stringSplit(inString)
- stringSplit(inString, delimiterString)
- stringSplit(inString, delimiterString, count)
- stringSplit(inString, delimiterString, count, compare)

Parameters

- inString - A String expression containing substrings and delimiters.
- delimiterString - An optional String character used to identify substring limits. If omitted, the space character (" ") is assumed to be the delimiter. If the delimiter is a zero-length string, a single-element array containing the entire inString string will be returned.
- count - An optional Number value of substrings to be returned. The value -1 indicates that all substrings will be returned. If omitted, -1 will be used.
- compare - An optional Number indicating the kind of comparison to use when evaluating the delimiter string:
  - 0 performs a comparison that is case-sensitive.
  - 1 performs a comparison that is case-insensitive.
  - If omitted, a case-sensitive comparison is performed.

Return value

Array of String values.

Examples

Assume that inString = "Welcome use JReport"

- `StringSplit(inString)` - Returns [ "Welcome", "use", "JReport"]
- `StringSplit(inString, "use")` - Returns [ "Welcome", "JReport"]
- `StringSplit(inString, " ", 2)` - Returns [ "Welcome", "use JReport"]

Note: If count, c, is less than the total number of substrings in inString, then at most c substrings will be returned as elements in the resultant array. The last element in the array is a concatenation of the substring and all the remaining substrings.