StringTools - Maple Programming Help

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

StringTools

 HasControlCharacter
 determine if a string contains a control character

 Calling Sequence HasControlCharacter(s)

Parameters

 s - string; string to test

Description

 • The HasControlCharacter( s ) command determines whether s contains a control character.
 If s contains a control character, HasControlCharacter returns true. Otherwise, false is returned.
 Note: A control character is a special non-printing character that is defined by the character set to which it belongs. For more information about control characters in Maple, see backslash.

 • The StringTools[HasControlCharacter] command is thread-safe as of Maple 15.
 > $\mathrm{with}\left(\mathrm{StringTools}\right):$
 > $s≔\mathrm{convert}\left(\left[\mathrm{}\left(1..255\right)\right],'\mathrm{bytes}'\right):$
 > $\mathrm{length}\left(s\right)$
 ${255}$ (1)
 > $\mathrm{HasControlCharacter}\left(s\right)$
 ${\mathrm{true}}$ (2)