Skip to content

Cm5StringStream.eat method

Cm5StringStream › eat

Unofficial

If the next character in the stream matches the given argument, it is consumed and returned.

Signature:

eat(match: string | RegExp | ((char: string) => boolean)): string

Parameters:

Parameter Type Description
match string | RegExp | ((char: string) => boolean) A character, regular expression, or predicate function.

Returns: stringThe matched character, or empty string if no match.