Previous Page Next Page Contents

text2list, text2tbl -- split a character string into substrings

Introduction

text2list splits a character string into a list of substrings.

text2tbl splits a character string into a table of substrings.

Call(s)

text2list(text, separators <, Cyclic>)
text2tbl(text, separators <, Cyclic>)

Parameters

text - the text to be analyzed: a character string
separators - delimiters: a list of character strings. The empty string is not accepted as a delimiter.

Options

Cyclic - the delimiter list is used cyclicly

Returns

a list, respectively a table, of character strings.

Related Functions

coerce, expr2text, int2text, tbl2text, text2expr, text2int

Details

Example 1

The following example demonstrates the difference in calling text2list with and without the option Cyclic:

>> text2list("This is a simple example!", ["is", "mp"])
       ["Th", "is", " ", "is", " a si", "mp", "le exa", "mp", "le!"]
>> text2list("This is a simple example!", ["is", "mp"], Cyclic)
               ["Th", "is", " is a si", "mp", "le example!"]

Example 2

The following example demonstrates the difference in calling text2tbl with and without the option Cyclic:

>> text2tbl("This is a simple example!", ["is", "mp"])
                              table(
                                9 = "le!",
                                8 = "mp",
                                7 = "le exa",
                                6 = "mp",
                                5 = " a si",
                                4 = "is",
                                3 = " ",
                                2 = "is",
                                1 = "Th"
                              ) 
>> text2tbl("This is a simple example!", ["is", "mp"], Cyclic)
                           table(
                             5 = "le example!",
                             4 = "mp",
                             3 = " is a si",
                             2 = "is",
                             1 = "Th"
                           )

Changes




Do you have questions or comments?


Copyright © SciFace Software GmbH & Co. KG 2000