StringTools
Snarf
extract a prefix consisting of specified characters from a string
Calling Sequence
Parameters
Description
Examples
Compatibility
Snarf( s, cset )
s
-
Maple string
cset
{string,symbol}; character set
The Snarf( s, cset ) command returns the prefix of the string s consisting of characters from the character set, cset.
The character set, cset, may be specified either as a string, whose characters are taken to be those in the character set, or a symbol, such as lower which represents the set of lowercase alphabetic characters.
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.
with⁡StringTools:
Snarf⁡abcdEFGHijklm,lower
abcd
Snarf⁡abcdEFGHijklm,abcdefghijklmnopqrstuvwxyz
Snarf⁡abcdEFGHijklm,xyzab
ab
Snarf⁡relative/path/to/some/file,α
relative
The StringTools[Snarf] command was introduced in Maple 18.
For more information on Maple 18 changes, see Updates in Maple 18.
See Also
cat
seq
string
StringTools[Take]
Download Help Document