We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
Replace suffix of string using map.
const mapReplaceSuffix = require('@extra-string/map-replace-suffix'); // mapReplaceSuffix(<string>, <map>, [max suffix length]) mapReplaceSuffix('ender', new Map([['er', ''], ['ing', ''], ['ed', '']])); // 'end mapReplaceSuffix('ender', new Map([['end', 'right'], ['start', 'left']])); // 'ender' (only suffix) mapReplaceSuffix('ender', new Map([['er', ' game'], ['game', 'play']]), 4); // 'end game' (only once)