Has - Maple Help
For the best experience, we recommend viewing online help using Google Chrome or Microsoft Edge.

Online Help

All Products    Maple    MapleSim


StringTools

  

Has

  

determine if a string contains a given character

 

Calling Sequence

Parameters

Description

Examples

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

withStringTools:

HasABC,A

true

(1)

HasABC,a

false

(2)

Hasfoo:bar,:

true

(3)

See Also

string

StringTools

StringTools[FirstFromLeft]

StringTools[FirstFromRight]

type[character]