trimer

A trim method that allows to trim multiple characters at both ends of a string

Usage no npm install needed!

<script type="module">
  import trimer from 'https://cdn.skypack.dev/trimer';
</script>

README

trimer

Removes all characters from the left and right end of a string given an array of characters or a string with one character only.

Build Status codecov Codacy Badge

Install

npm install trimer

Usage

With arrays

const trimer = require('trimer')

trimer("  bbbbbtest ////aaaaa", ["/", " ", "a", "b"])
// 'test'

With strings

const trimer = require('trimer')

trimer("/test////", "/")
// 'test'