Choose where you’d like to start

toList

Overview

The toList function takes source text and a separator as arguments. The source text is tokenised using the separator. All tokens are then converted into a list.

Note:

  • Text values punctuated by the separator will be the list's elements.
  • If a separator is not provided or if the provided separator does not appear in the source text, the entire source text is returned as a single element of a list.
  • If separators appear consecutively in the source text, all empty occurrences will be empty elements of the list.

Return Type

  • LIST

Syntax

<variable> = <source_text>.toList(<separator>);

where,

ParameterData typeDescription
<variable>LISTVariable which will contain the returned List.
<source_text>TEXTThe piece of text with separators that needs to converted to a list.
<separator>TEXTThe separator literal which would punctuate the different elements in the source text.

Examples

 products  =  "ZohoCreator/ZohoCRM";
 productList  =  products.toList("/");
 info productList; // Returns ZohoCreator,ZohoCRM

Get Started Now

Execute