super-trim

Trim whitespaces (or other characters) from the beginning and end of strings.

View the Project on GitHub beeblebrox3/super-trim

Super trim

Trim string whitespaces (or other characters) from the beginning and end of strings.

Scrutinizer Code Quality Code Coverage Build Status

Usage

const trim = require("super-trim");
trim("  trim  ");             // output: "trim"
trim("//trim//", "/");        // output: "trim"

trim.left("  trim  ");        // output: "trim  "
trim.left("//trim//", "/");   // output: "trim//"

trim.right("  trim  ");        // output: "  trim"
trim.right("//trim//", "/");   // output: "//trim"