from-after
API
operand::fromAfter(pattern)
Returns the trimmed string.
Looks for a pattern in a string and, if the pattern is found, cuts off the string after the first occurrence of the pattern.
Designed for use with ::
function bind syntax, as the this
property should be the string to trim.
operand
String to trim.
pattern
String to look for and trim after.
Use Case
const filepath = '~/app/node_modules/foo/bar.js' filepath::// -> 'foo/bar.js`
See Also
- from-before ⟼
- from-after ⇤
- until-before ⇥
- until-after ⟻
const text = 'goodbye cruel world' text:: // 'cruel world'text:: // ' world'text:: // 'goodbye 'text:: // 'goodbye cruel'
Colophon
Made by Sebastiaan Deckers in Singapore 🇸🇬