Skip to content
Useful extensions to the javascript String object
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.

README.md

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.

Something went wrong with that request. Please try again.