next up previous contents
Next: Built-in Functions for Sets, Up: Strings Previous: The period Operator

The CreateString Function

We can define a new string object via the command
CreateString(dim : posint , init : symbol)
where dim is the length of string and init is the initial value for each element of the string. This init symbol must be a letter $a\ldots z$, $A \ldots Z$, or the underscore symbol (_). If CreateString is called with only one argument, the string is initialized to the space symbol.

> let_there_be_space := CreateString(10000): # but let's not display it

> str := CreateString(100, a);
str := aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
> type(let_there_be_space, string); 

Gaston Gonnet