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

Online Help

All Products    Maple    MapleSim


StringTools

  

Snarf

  

extract a prefix consisting of specified characters from a string

 

Calling Sequence

Parameters

Description

Examples

Compatibility

Calling Sequence

Snarf( s, cset )

Parameters

s

-

Maple string

cset

-

{string,symbol}; character set

Description

• 

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.

Examples

withStringTools:

SnarfabcdEFGHijklm,lower

abcd

(1)

SnarfabcdEFGHijklm,abcdefghijklmnopqrstuvwxyz

abcd

(2)

SnarfabcdEFGHijklm,xyzab

ab

(3)

Snarfrelative/path/to/some/file,α

relative

(4)

Compatibility

• 

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

StringTools[Take]