HasSpace - Maple Help

StringTools

 HasSpace
 determine if a string has any space characters

 Calling Sequence HasSpace(s)

Parameters

 s - string; string to test

Description

 • The HasSpace(s) command determines whether s has any space characters.
 A space character is any one of the following:

 Space Character Meaning ASCII Code  '' space 32 \t'' horizontal tab 9 \n'' new line 10 \r'' carriage return 13 \f'' form feed 12 \v'' vertical tab 11

 If s is a space character, HasSpace 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[HasSpace] command is thread-safe as of Maple 15.

Examples

 > $\mathrm{with}\left(\mathrm{StringTools}\right):$
 > $\mathrm{HasSpace}\left("foobar"\right)$
 ${\mathrm{false}}$ (1)
 > $\mathrm{HasSpace}\left("foo bar"\right)$
 ${\mathrm{true}}$ (2)
 > $\mathrm{HasSpace}\left("foo\tbar"\right)$
 ${\mathrm{true}}$ (3)
 > $\mathrm{HasSpace}\left("foo\nbar"\right)$
 ${\mathrm{true}}$ (4)