Read Me - Common Public License V1.0 - Copyright Notice(©)

makeArray


>>-makeArray(-+-----------+-)----><
              +-Separator-+

This method returns an array of strings containing the single lines that were separated using the [separator] string. The separator may be any string, including the null string. If the null string is used, an array containing each character of the string is returned. If the target string starts with the separator, the first array item will be a null string. If the string ends with a separator, no extra null string item will be added. The default separator is the newline character.

String class - makeArray method


string = "hello".endofline"world".endofline"this is an array."
array = string~makeArray
say "the second line is:" array[2]  /*  world  */

string = "hello*world*this is an array."
array = string~makeArray("*")
say "the third line is:" array[3]  /*  this is an array.  */

string = "hello*world*this is an array.*"
array = string~makeArray("*")     /* contains 3 items */

Read Me - Common Public License V1.0 - Copyright Notice(©)