Skip to content
Swiss knife for easy and immutable manipulation with strings in javascript.
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
test
.gitignore
.travis.yml
LICENSE.md
README.md
bower.json
package.json

README.md

Stringer.js Build Status

Swiss knife for easy and immutable manipulation with strings in javascript.

How to install

npm install stringer.js
bower install stringer.js

How to use

Construct a new Stringer object

var str = s('Hello! I am Stringer and I cost exactly $0! ♥');

And use as follows

str.justNumber().toInt();
// 0

str.only(18).justLetters().toUpper().only(14).toString();
// HELLOIAMSTRING

str.webalize().toString();
// hello-i-am-stringer-and-i-cost-exactly-0

str.toTruncated(5);
// Hello…

Available methods

  • just
  • justLetterAndNumbers
  • justLetters
  • justNumbers
  • justDecimals
  • removeDiacritics
  • webalize
  • rtrim
  • ltrim
  • lpad
  • rpad
  • escapeRegExp
  • toUpper
  • toLower
  • only
  • thousands
  • isNumber
  • contains
  • toFloat
  • toInt
  • toString
  • toBool
  • toTruncated
Something went wrong with that request. Please try again.