StringTools - Maple Programming Help

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.

 • The StringTools[HasPrintable] command is thread-safe as of Maple 15.

Examples

 > $\mathrm{with}\left(\mathrm{StringTools}\right):$
 > $s≔\mathrm{Ι}\left(1,255\right):$
 > $\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.