Initializing help system before first use

splittext

Purpose
Split a text string.
Synopsis
function splittext(ts:text, sep:string):list of text
function splittext(ts:text, sep:string, mxe:integer):list of text
function splittext(qt:integer, ts:text, sep:string):list of text
function splittext(qt:integer, ts:text, sep:string, mxe:integer):list of text
Arguments
qt 
Quoting type (see parameter sys_qtype, default: -1 for no quoting)
ts 
Text string to process
sep 
Separator string
mxe 
Maximum number of elements to collect (default: 0 for no limit)
Return value
The list of identified items.
Example
The following statements:
write(splittext("some/path/to/a.file","/",-2))
writeln(splittext(2,'cv1,"cv""2""",cv3',","))
result in this display: [some/path/to,a.file][cv1,cv"2",cv3]
Further information
1. This function splits the input text string ts using the string sep as the field delimiter and returns the identified items as a list of texts. The argument mxe defines a maximum number of elements to put into this result list. If this limit is reached while the input string has not been entirely processed the last added item includes the remaining part of the input data as a single record.
2. When the quoting type is not specified or when it is set to -1 the separator string may be an empty string and the maximum number of elements may take a negative value. With an empty separator the input text is split into individual characters. If the maximum number of elements is negative the decomposition is performed from the end of the string.
3. When quoting is active ( i.e. qt is not -1) a parsing error may occur: in this case the system status it set to a non-zero value (see getsysstat) and the parsing is interrupted (typically after an error the last item added to the result list is not valid).
Related topics
Module

© 2001-2025 Fair Isaac Corporation. All rights reserved. This documentation is the property of Fair Isaac Corporation (“FICO”). Receipt or possession of this documentation does not convey rights to disclose, reproduce, make derivative works, use, or allow others to use it except solely for internal evaluation purposes to determine whether to purchase a license to the software described in this documentation, or as otherwise set forth in a written software license agreement between you and FICO (or a FICO affiliate). Use of this documentation and the software described in it must conform strictly to the foregoing permitted uses, and no other use is permitted.