Has - Maple Help

StringTools

 Has
 determine if a string contains a given character

 Calling Sequence Has( s, ch )

Parameters

 s - string; string to test ch - character; character to test against

Description

 • The Has( s, ch ) command determines whether the string s contains the character ch. It returns the value true if s contains ch, and false otherwise.
 • The string ch must not be the empty string. Furthermore, if the length of ch is greater than $1$, then characters in ch after the first are ignored.
 • 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.

Examples

 > $\mathrm{with}\left(\mathrm{StringTools}\right):$
 > $\mathrm{Has}\left("ABC","A"\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{Has}\left("ABC","a"\right)$
 ${\mathrm{false}}$ (2)
 > $\mathrm{Has}\left("foo:bar",":"\right)$
 ${\mathrm{true}}$ (3)