string-replacesuffix
v0.1.3
Published
Replace suffix match in string with specified value.
Downloads
6
Readme
string-replacesuffix
NOTE: string-replacesuffix was renamed to @extra-string/replace-suffix.
Replace suffix match in string with specified value.
const replaceSuffix = require('string-replacesuffix');
// replaceSuffix(<string>, <suffix>, <replaced value>)
replaceSuffix('tinman', 'man', 'woman');
// 'tinwoman'
replaceSuffix('muscleman', 'cle', 'cled');
// 'muscleman'
replaceSuffix('laughed', 'ed', '');
// 'laugh'