Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

rmtrailing

danielcobo11MIT1.0.3

Removes dynamic trailing substring

trailing, string, substring, dynamic, remove

readme

rmTrailing

Removes dynamic trailing substring. Use if: what you want to remove is stored in a variable. Otherwise: you may want to use .replace() or a more specific module

How to use

Prerequisite

None

Example

var slash = '/';

rmTrailing('hello/world/', slash); //'hello/world',
rmTrailing('hello/world//', slash); //'hello/world'
rmTrailing('hello/world', slash) //'hello/world'
rmTrailing('///', slash); //''
rmTrailing('', slash) //''