Radash
  1. String
  2. trim

‚Äč
Basic usage

Trims all prefix and suffix characters from the given string. Like the builtin trim function but accepts alternate (other than space) characters you would like to trim.

import { trim } from 'radash'

trim('  hello ') // => hello
trim('__hello__', '_') // => hello
trim('/repos/:owner/', '/') // => repos/:owner

Trim also handles more than one character to trim.

trim('222__hello__111', '12_') // => hello