Text.Split
From Xojo Documentation
Returns an array of the characters in the Text.
Supported for all project types and targets.
Returns an array of the portions of the Text that are delimited by separator. If separator is the same as the text, an empty array is returned. If the text does not contain separator, an array containing only the original text value is returned.
Parameters
Parameter | Description |
---|---|
separator | The separator value used to split the text. |
compareOptions | (Optional) Comparison options. Use constant CompareCaseSensitive for case-sensitive comparisons. |
locale | (Optional) The locale to use for comparisons. By default an invariant locale (not dependent on the system settings) is used. |
Notes
By default this performs a case-insensitive comparison. To do a case-sensitive comparison, supply the CompareCaseSensitive constant to the compareOptions parameter. By default comparisons are done in an invariant locale (i.e. not dependent on the user's preferences). The locale parameter can be used to specify an explicit locale to do comparisons in.
Split provides equivalent functionality to String.NthField.
Exceptions
- RuntimeException if the options specified are invalid.
- InvalidArgumentException if separator is an empty text value.
Sample Code
Split the text into "Hello" and "World":
Splits the text into an array with one element for each character: