HomeManualTopicsTypesSymbols

std_types::character/std::match

matches the start of a string with the character

Parameters

self
the character to match with
str
the string which's start is matched

Result

len
1 if the character is the first character of the string

Description

If the match is unsuccessful, then len is std::undefined.

Example

$str "abcdef" $len match('a' str) dump! `len

Output

len: 1

Example

$str "abcdef" $len match('z' str) dump! `len

Output

len: <undefined>

Topic

Strings

Implements

std::match match the grammar object with the start of the specified string

See also

std::match_back match the grammar object with the end of the specified string
std::search search from the grammar object from the start or end of the specified string