StringTools
Tabulate
generate strings over integer ranges
Calling Sequence
Parameters
Description
Examples
Tabulate( p, n )
p
-
procedure mapping integers to characters
n
positive integer or character
The Tabulate(p, n) command generates strings over integer ranges. It constructs the string cat⁡seq⁡p⁡i,i=1..n. For an integer i in the range 1..n, the expression p⁡i must evaluate to a string of type character. Typically, p is of type procedure. The second argument n must be a non-negative 32-bit integer.
All of the StringTools package commands treat strings as (null-terminated) sequences of 8-bit (ASCII) characters. Thus, there is no support for multibyte character encodings, such as unicode encodings.
with⁡StringTools:
evalb( Tabulate( Char, 200 ) = Iota( 1, 200 ) );
true
Tabulate⁡n↦`if`⁡n::even,b,a,100
abababababababababababababababababababababababababababababababababababababababababababababababababab
Tabulate⁡n↦Char⁡n+Ord⁡a−1,26
abcdefghijklmnopqrstuvwxyz
Tabulate⁡n↦`if`⁡n::prime,*,.,2000
.**.*.*...*.*...*.*...*.....*.*.....*...*.*...*.....*.....*.*.....*...*.*.....*...*.....*.......*...*.*...*.*...*.............*...*.....*.*.........*.*.....*.....*...*.....*.....*.*.........*.*...*.*...........*...........*...*.*...*.....*.*.........*.....*.....*.....*.*.....*...*.*.........*.............*...*.*...*.............*.....*.........*.*...*.....*.......*.....*.....*...*.....*.......*...*.......*.........*.*.........*.*.....*...*.....*.......*...*.*...*...........*.......*...*.......*...*.....*...........*.*.................*.....*.........*.....*.....*.*.....*.........*.....*.....*.*.....*.....*...*.*...........*.........*.*...*.....*.....*.*...........*...*.....*.......*.........*.......*.........*.......*.....*.....*...*.......*.....*...*.......*...*.............*.........*...........*.*.........*.*...*.*.........*.............*...*.*...*.............*...*.*...*...................*...*.......*.........*.......*...*.....*.....*.............*...*.....*.....*.......*.....*...........*...*.....*.*.........*.*.....*.........*.*.........*.*.....*.................*...*.*...*.....*.....*.......*.....*.....*.....................*.*.........*.......*.........*.....*.....*.......*...........*...*.....*.....*.*.....*...........*.........*.................*.*...*.....*.*.....*...*.*...*...........*.*.....*.................................*.....*.....*.......*.................*.........*.............*...*.*...*.....*.......*...*.*.....*...........*.........*.*...*.*...*.....*...........*...........*.......*...........*.....*...*.....*.......*...*.......*...*.............*...*.....*.*...*.....*.*.....*.........*...................*.....*...*.*.......................*...*.*.........*...........*.*.........*.......*.....*.....*.....*.................*.....*...*.*...........*.........*...........*.......*...............*.............*.....*...*.*...*.*.........*...........*.....*.....*.................*.*...............*.*.....................*.....*.......*.....*...*.*.
See Also
cat
seq
string
StringTools[Char]
StringTools[Iota]
StringTools[Ord]
type,character
type,procedure
Download Help Document