RandomTools Flavor: string
describe a random string
Calling Sequence
Parameters
Description
Examples
Compatibility
string(n)
string(n, alphabet)
n
-
non-negative integer, or flavor describing a non-negative integer
alphabet
string, or symbol indicating an alphabet
The flavor string(n) describes a string of length n. The flavor string(n, alphabet) describes a string of length n, where the characters are selected from the given alphabet.
Maple generates the string by calling StringTools[Random]. That help page describes how the optional alphabet parameter is interpreted. The default alphabet is print.
This flavor can be used as an argument to RandomTools[Generate] or as part of a structured flavor.
with⁡RandomTools:
Generate a string of 30 characters.
Generate⁡string⁡30
\"y 5,8KN+hc%GK09m_-x*Y(YTx*7R
Generate a list of 10 strings, each of a length between five and 15, and consisting of alphanumeric characters.
Generate⁡list⁡string⁡integer⁡range=5..15,alnum,10
PYLR9k1yzmiKL,f6LmmfFAydhnl2f,4MJoY2Q,s0WdU,dEhIGQnsAHuTpQ,a5C8T6ha,3Q3tAsG3hZpFYsl,vt3PnWsh9KRS,AMfiAVlT,Q4vv8A
The RandomTools Flavor: string command was updated in Maple 2019.
The n and alphabet parameters were introduced in Maple 2019.
For more information on Maple 2019 changes, see Updates in Maple 2019.
See Also
flavor/structured
rand
RandomTools
RandomTools[Generate]
string
StringTools[Random]
Download Help Document