strip-outer

Strip a substring from the start/end of a string

Usage no npm install needed!

<script type="module">
  import stripOuter from 'https://cdn.skypack.dev/strip-outer';
</script>

README

strip-outer

Strip a substring from the start/end of a string

Install

$ npm install strip-outer

Usage

import stripOuter from 'strip-outer';

stripOuter('foobarfoo', 'foo');
//=> 'bar'

stripOuter('unicorncake', 'unicorn');
//=> 'cake'