Returns the source string up until (and excluding) match.
source
match
By default, if match is not found, all of source is returned.
// Yields `apple `untilMarch(`apple orange melon`, `orange`); Copy
// Yields `apple `untilMarch(`apple orange melon`, `orange`);
If match is not found, fallback can be returned instead:
// Yields 'lemon'untilMatch(`apple orange mellon`, `kiwi`, { fallback: `lemon` }); Copy
// Yields 'lemon'untilMatch(`apple orange mellon`, `kiwi`, { fallback: `lemon` });
Or an exception thrown
// ThrowsuntilMatch(`apple orange mellon`, `kiwi`, { ifNoMatch: `throw` }); Copy
// ThrowsuntilMatch(`apple orange mellon`, `kiwi`, { ifNoMatch: `throw` });
If provided, gives the starting offset. Default 0
Returns the
source
string up until (and excluding)match
.By default, if match is not found, all of
source
is returned.If match is not found, fallback can be returned instead:
Or an exception thrown