|
This function is used to split up the forwarded string expression and to assign the individual substrings to a specified string array. The result of this function is the number of assigned substrings. |
|||
![]() |
Using the third (optional) parameter the separator to be used and defaults for handling quotation marks, etc. can be defined. Spaces, quotation marks and brackets at the beginning and the end of each substring are removed. | |||
Syntax: |
||||
{INT_VAR}= split ({STR_EXPR}, {STR_VAR}) or |
||||
I/O parameters: |
||||
Return value: |
||||
|
||||
Example: |
||||
Declaration of Variables | ||||
10 DOCU_STRING_1 = "'1234;atc'; '1235;abb'; '1236;xcf'; '1237;uhg'" 20 DOCU_INT_1 = split(DOCU_STRING_1,DOCU_STRING_ARRAY_1[1], "/SEPARATOR=; /SINGLE_QUOTE") 30 DOCU_INT_2 = 1 40 while ( DOCU_INT_2 <= DOCU_INT_1 ) 50 put(DOCU_STRING_ARRAY_1[DOCU_INT_2]) 60 DOCU_INT_2=DOCU_INT_2+1 70 done |
||||
Result: | ||||
In this example the separators withing the substrings are ignored, because the single quotation marks are respected. However, the single quotation marks are removed. |
||||
![]() |
Functions and commands: Editing Strings |