Purpose
With linerecordsplit(), you can break up a long string into its smaller strings, based on the parameters you define. You can specify the parts by using the 'label' and 'length' option pair as described below. This command is available in WS builds of 1.2.194.0 and above.
Syntax
var elementArr = linerecordsplit(z_string,[{"label":"NUMBERS","length":10},{"label":"ALPHABETS","length":20}]);
Property
- z_string - String variable.
Available Options
You can use the following options with the linerecordsplit:
"label":"string","length":size - Splits the string provided in the Label with respect to the corresponding length. |
Options Detail
Example
In the following example, we will split a string into its component parts using the 'linerecordsplit' command.
-
Create a string variable.
-
Invoke the linerecordsplit() command using the Script code.
-
In your script, print out the new components of the original string.
var z_string="222334455689PoojithaTechnicalWriter"; var elementArr = linerecordsplit(z_string,[{"label":"NUMBERS","length":10},{"label":"ALPHABETS","length":20}]); println(elementArr.NUMBERS); println(elementArr.ALPHABETS);