HasIdentifier - Maple Help

StringTools

 HasIdentifier
 determine if a string contains valid unquoted Maple identifier characters
 HasIdentifier1
 determine if a string contains valid Maple identifier initial characters

 Calling Sequence HasIdentifier(s) HasIdentifier1(s)

Parameters

 s - string; string to test

Description

 • The HasIdentifier(s) command determines whether s contains characters that are valid as a character in an unquoted Maple identifier.
 If s contains valid characters, HasIdentifier returns true. Otherwise, false is returned.
 • The HasIdentifier1(s) command determines whether s contains any characters that are valid as the first character of an unquoted Maple identifier.
 If s has any characters valid as the first character, HasIdentifier1 returns true. Otherwise, false is returned.
 • 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.

 • The StringTools[HasIdentifier] and StringTools[HasIdentifier1] commands are thread-safe as of Maple 15.

Examples

 > $\mathrm{with}\left(\mathrm{StringTools}\right):$
 > $\mathrm{HasIdentifier}\left("\n\t?"\right)$
 ${\mathrm{true}}$ (1)
 > $\mathrm{HasIdentifier}\left("foo bar"\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{HasIdentifier1}\left("\n\t?"\right)$
 ${\mathrm{false}}$ (3)
 > $\mathrm{HasIdentifier1}\left("foo bar"\right)$
 ${\mathrm{true}}$ (4)