StringTools - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Names and Strings : StringTools Package : Miscellaneous Utilities : StringTools/NthWord

StringTools

  

NthWord

  

generate the nth word on a given alphabet

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

NthWord( alphabet, n )

Parameters

alphabet

-

string; alphabet to use

n

-

non-negative integer; nth word to generate

Description

• 

The NthWord(alphabet, n) command generates the nth word on the given ordered alphabet, which consists of the characters in the string alphabet. The string alphabet must not contain repeated characters. Words are enumerated in shortlex order.

• 

The 0th word on any alphabet is the empty string .

Examples

withStringTools:

seqNthWordabc,i,i=1..20

a,b,c,aa,ab,ac,ba,bb,bc,ca,cb,cc,aaa,aab,aac,aba,abb,abc,aca,acb

(1)

seqNthWordabcde,i,i=1..20

a,b,c,d,e,aa,ab,ac,ad,ae,ba,bb,bc,bd,be,ca,cb,cc,cd,ce

(2)

NthWordabc,2311

abaababbbaacccacacca

(3)

NthWordabc,5

ab

(4)

NthWordbca,5

bc

(5)

See Also

length

StringTools

StringTools[Fill]

StringTools[Generate]

 


Download Help Document

Was this information helpful?



Please add your Comment (Optional)
E-mail Address (Optional)
What is ? This question helps us to combat spam