StringTools - Maple Programming Help

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

StringTools

 HasPunctuation
 determine if a string contains a punctuation character

 Calling Sequence HasPunctuation(s)

Parameters

 s - string; string to test

Description

 • The HasPunctuation( s ) command determines whether s contains a punctuation character. Punctuation characters are printable characters, other than whitespace, for which neither IsControlCharacter nor IsAlphaNumeric returns true.
 • If s contains a punctuation character, HasPunctuation returns true. Otherwise, false is returned.

 > $\mathrm{with}\left(\mathrm{StringTools}\right):$
 > $\mathrm{HasPunctuation}\left("abcde"\right)$
 ${\mathrm{false}}$ (1)
 > $\mathrm{HasPunctuation}\left("abc,de"\right)$
 ${\mathrm{true}}$ (2)