0.0.1 • Published 8 years ago

cw-string-polyfill v0.0.1

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

cw-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

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.