@cubitworx/string-polyfill

0.1.0 • Public • Published

@cubitworx/string-polyfill

String polyfill methods for ECMAScript 6 specification & other usefull string manipulation

Implements

  • String.capitalise - Capitalise first letter of first word (all words) in input string
  • String.repeat - Repeat input string specified number of times

Install

npm install @cubitworx/string-polyfill

Usage

// String.capitalise
console.log( 'this is a test string'.capitalise() ); // This is a test string
console.log( 'this is a test string'.capitalise(true) ); // This Is A Test String
console.log( 'this-is-a-test-string'.capitalise(true,'-') ); // This-Is-A-Test-String

// String.repeat
console.log( 'x'.repeat(3) ); // xxx

Copyright and license

Code and documentation copyright 2016 Charles Louw. Code released under the MIT license.

Readme

Keywords

none

Package Sidebar

Install

npm i @cubitworx/string-polyfill

Weekly Downloads

0

Version

0.1.0

License

MIT

Last publish

Collaborators

  • cubitworx