Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/gfarrell/string.js

Useful extensions to the javascript String object
https://github.com/gfarrell/string.js

Last synced: 13 days ago
JSON representation

Useful extensions to the javascript String object

Awesome Lists containing this project

README

        

String.js
=========

Useful extensions to the javascript String object. This directly extends `String.prototype` so you can access all these as though they were native functions.

## String.capitalise

myStr.capitalise();

Capitalises the first letter of each word.

## String.underscore

myStr.underscore();

Converts spaces, hyphens and camelCasing to underscores, all in lower case.

## String.deUnderscore

myStr.deUnderscore();

Replaces underscores with spaces, all lower case.

## String.hyphenate

myStr.hyphenate();

Converts spaces, underscores and camelCasing to hyphens, all in lower case.

## String.deHyphenate

myStr.deHyphenate();

Replaces hyphens with spaces, all lower case.

## String.camelCase

myStr.camelCase();

Converts spaces, underscores and hyphens to camelCasing.

## String.deCamelCase

myStr.deCamelCase();

Replaces camelCasing with spaces, all lower case.

## String.format

*Not yet implemented.*