Language Reference Guide : System Classes : StringObject Class : Split Method
 
Share this page          
Split Method
The Split method splits the StringObject contents into an array of StringObjects and returns them.
This method has the following syntax:
array of StringObject = StringObject.Split(delimiter = varchar(256)
          [, ignorecase = integer] [, backwards = integer]
          [, exactrows = integer] [, minrows = integer]
          [, includedelimiter = integer]
          [, preserveblanklasttoken = integer]
          [, preserveleadingwhitespace = integer])
This method has the following parameters:
delimiter
(Required) Specifies one or more delimiters used to split the string into substrings. Multiple parameters must be separated by the character pair "\," (backslash, comma).
ignorecase
Specifies whether delimiters within the StringObject will be searched for, ignoring case (TRUE) or not (FALSE). The default is FALSE.
backwards
Specifies whether delimiters within the StringObject will be searched for, starting from the end (TRUE) or not (FALSE). The search starts with the leftmost character of the text being searched for, not the rightmost character. The default is FALSE.
exactrows
Specifies the exact number of rows that the returned array must contain. If there are more delimiters in the StringObject than exactrows specifies, the final entry may contain delimiters; if there are fewer delimiters, the final entry or entries will contain empty StringObjects.
minrows
Specifies the minimum number of rows that the returned array must contain. If there are fewer delimiters in the StringObject than minrows specifies, the final entry or entries will contain empty StringObjects.
includedelimiter
Specifies whether each delimiter found within the StringObject will be added to the returned array (TRUE) or not (FALSE). The default is FALSE.
preserveblanklasttoken
Specifies whether the last token (the string following the last delimiter) will be included if it is actually blank. The default is FALSE.
preserveleadingwhitespace
Specifies whether substrings created by the split will preserve any leading whitespace (TRUE) or not (FALSE). The default is FALSE.
Split points are identified by one or more delimiters; delimiters can be any length up to 256 characters. Multiple delimiters (themselves separated by "\," in the parameter value) are applied in round-robin fashion, and the nearest match is used. Leading whitespace is removed from each token by default, unless preserveleadingwhitespace=TRUE.
The return array can optionally include the delimiters as StringObjects (the number of rows returned becomes 2n-1). This enables global character and substring replacement.
Matching can be case-insensitive or backwards; the number of rows returned can be specified as an exact number or a minimum.
This method returns an array of StringObject.