StringTools - Maple Programming Help

# Online Help

###### All Products    Maple    MapleSim

Home : Support : Online Help : Programming : Names and Strings : StringTools Package : Character Class Tests : StringTools/HasPrintable

StringTools

 HasPrintable
 determine if a string has any printable characters

 Calling Sequence HasPrintable(s)

Parameters

 s - string; string to test

Description

 • The HasPrintable(s) command determines whether s has any printable characters. Printable characters are identified by the predicate IsPrintable.
 If s contains a printable character, then HasPrintable returns true. Otherwise, false is returned.
 • 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.

Thread Safety

 • The StringTools[HasPrintable] command is thread-safe as of Maple 15.
 • For more information on thread safety, see index/threadsafe.

Examples

 > $\mathrm{with}\left(\mathrm{StringTools}\right):$
 > s := Iota( 1, 255 ):
 > $\mathrm{HasPrintable}\left(s\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{IsPrintable}\left(s\right)$
 ${\mathrm{false}}$ (2)
 > $\mathrm{HasPrintable}\left(\mathrm{Select}\left(\mathrm{IsPrintable},s\right)\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{HasPrintable}\left(\mathrm{Remove}\left(\mathrm{IsPrintable},s\right)\right)$
 ${\mathrm{false}}$ (4)

Compatibility

 • The StringTools[HasPrintable] command was updated in Maple 2017.

 See Also