StringTools - Maple Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Names and Strings : StringTools Package : Combinatorics on Words : StringTools/IsMonotonic

StringTools

  

IsMonotonic

  

test whether a string is a palindrome

 

Calling Sequence

Parameters

Description

Examples

Calling Sequence

IsMonotonic( s )

Parameters

s

-

string

Description

• 

The IsMonotonic(s) command returns the value true if s is monotonic, and the value false otherwise. A string is monotonic if the sequence of characters it comprises is non-increasing or non-decreasing, when the characters are identified with their ASCII code points.

• 

Every string can be factored into a product of monotonic substrings by using StringTools[MonotonicFactors].

• 

If s is the empty string, the command returns true.

Examples

withStringTools:

IsMonotonic

true

(1)

IsMonotonicaaa

true

(2)

IsMonotonicabc

true

(3)

IsMonotoniccba

true

(4)

IsMonotoniccab

false

(5)

IsMonotonicabcba

false

(6)

andmapIsMonotonic,MonotonicFactorsRandom1000,'lower'

true

(7)

See Also

string

StringTools

StringTools[MonotonicFactors]

 


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