remove-trailing-path-separator

1.0.3 • Public • Published

remove-trailing-path-separator

NPM version Travis-CI Status Appveyor Status Daviddm Status

Remove trailing path separator from string.

Install

$ npm install --save remove-trailing-path-separator

Usage

var removeTrailingPathSeparator = require('remove-trailing-path-separator');

removeTrailingPathSeparator('/foo/bar/baz/');
//=> /foo/bar/baz
removeTrailingPathSeparator('/foo/bar/baz//');
//=> /foo/bar/baz
removeTrailingPathSeparator('\\foo\\bar\\baz\\');
//=> \\foo\\bar\\baz
removeTrailingPathSeparator('\\foo\\bar\\baz\\\\');
//=> \\foo\\bar\\baz

API

removeTrailingPathSeparator(input) -> String

input

Required
Type: string

Like path string.

Changelog

changelog.md.

License

MIT © sanemat

Package Sidebar

Install

npm i remove-trailing-path-separator

Weekly Downloads

4

Version

1.0.3

License

MIT

Unpacked Size

4.95 kB

Total Files

5

Last publish

Collaborators

  • sanemat