Skip to content
No description or website provided.
JavaScript
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
.gitignore
README.md
bower.json
string.js

README.md

string-lib.js

Provides utility functions for strings.

Reference

String.prototype.format

Description: Converts slugs("{{slug}}") in string to given values.

Arguments: Key and value or object with slugs as keys and slug values as values.

Return: Formatted string.

Example:

var str = 'Hello {{ name }}!';
console.log(str.format('name', 'world')); // 'Hello world!'
console.log(str.format({ name: 'string-lib.js' })) // 'Hello string-lib.js!'
Something went wrong with that request. Please try again.