-
Notifications
You must be signed in to change notification settings - Fork 2
string_explode
Hyomoto edited this page Jun 13, 2021
·
6 revisions
| Jump To | Go Back |
Arguments |
|---|
Returns: array
Throws: InvalidArgumentType
Breaks the input string up based on divider and returns the results as an array. If trim is true, whitespace will also be trimmed from each element. If a non-string is provided for string or divider, or a non-number for trim, InvalidArgumentType will be thrown.
string_explode( "cat, bat, rat, hat", "," );
Output: [ "cat","bat","rat","hat" ]
| Name | Type | Purpose |
|---|---|---|
| string | string |
The string to explode |
| divider | string |
The character(s) to use to break up the string |
| *trim | bool |
optional: Whether to trim whitespace from each item |
Devon Mullane 2020