
text2list - converts a string into a list

Calling sequence:
text2list(string, [ string_1, ...], [ Cyclic ]  )

Parameter:
string     --  character string
string_1   --  character string
Cyclic     --  option

Overloading:

all

Summary:

text2list decomposes the character stringstring into substrings and then
stores them in a new list. This list is then returned.

For the decomposition of string the strings in the list [string_1 ...]
are used as separators.  If the option Cyclic is not given then string is
decomposed as follows: string is searched for the first appearence of one of
the separators in the list [string_1 ...].  All the characters up to this
seperator are entered as the first entry in the list, the seperator is entered as
the second element. The remaining character string is further processed as

above except that the beginning of the character strings and the seperators
are added to the list.  This process is carried out until there are no more
characters in the string.

If the option Cyclic is given as the last argument of text2list then string
is cyclically decomposed. At first, string is searched for the first appearance
of the first separator string string_1. Once again all characters up to the
seperator are stored under the index 1 and the seperator under index 2. Then
the remaining string is search for the first appearance of the next separator.
Again the characters up to the seperator string are stored under index 3 and
the seperator under index 4.  This process is carried out as long as there
are characters in string which are not already stored in the result.  If the
list of seperators is worked through the process is carried out using the first
separator.

text2list is a kernel function.

>>  text2list("Oh,a text,how nice!", ["an","how","a"]);

      [ "Oh,", "a", " text,", "how", " nice!" ]

>>  text2list("Oh,a text,how nice!", [" ",","],Cyclic);

      [ "Oh,a", " ", "text", ",", "how", " ", "nice!"  ]

See also:  tbl2text , text2expr , text2tbl

