string-replaceprefix
v0.1.3
Published
Replace prefix match in string with specified value.
Downloads
12
Readme
string-replaceprefix
NOTE: string-replaceprefix was renamed to @extra-string/replace-prefix.
Replace prefix match in string with specified value.
const replacePrefix = require('string-replaceprefix');
// replacePrefix(<string>, <prefix>, <replaced value>)
replacePrefix('tinman', 'tin', 'gun');
// 'gunman'
replacePrefix('muscleman', 'cle', 'cled');
// 'muscleman' (not prefix)
replacePrefix('-1.6022e-19', '-', '');
// '1.6022e-19'