string-concluding
v2.0.2
Published
Extract part of a string including last occurrence of substring.
Downloads
4
Readme
string-concluding
Extract part of a string including last occurrence of substring.
npm i --save string-concluding
Usage
const concluding = require('string-concluding')
const a = '/Applications/Terminal.app/Resources/com.apple.terminal/bin'
const path = concluding('.app/', a).slice(0, -1)
console.log(path)
// '/Applications/Terminal.app'
const b = 'poof'
const poof = concluding('boom', b)
console.log(poof)
// 'poof'