StringTools - Maple Programming Help

Online Help

All Products    Maple    MapleSim


Home : Support : Online Help : Programming : Names and Strings : StringTools Package : Filter Operations : StringTools/Snarf

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.

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]