A collection of the String Object prototype methods.
Pads a string with the specified character(s) either before or after the current value.
myString.pad(length, string, direction);
var tonyTheTigerSez = "They're gr".pad(5, 'r') + 'eat!'; //returns "They're grrrrrreat!"
Repeats a string a specified number of times.
myString.repeat(times);
var one = "1"; var eleventyOne = one.repeat(3); //returns "111"
Removes non-ascii characters and converts them to their most appropriate ascii character.
myString.standardize();
var bjorkProper = "Björk"; var bjorkAscii = bjorkProper.standarize(); //returns "Bjork"
Remove all html tags from a string.
myString.stripTags();
var html = "<b>This is a string with <i>html</i> in it.</b>" var noHtml = html.stripTags(); //returns "This is a string with html in it."
Replaces common special characters with their ASCII counterparts (smart quotes, elipse characters, stuff from MS Word, etc.).
var tidyString = stringWithBadChars.tidy();
This documentation is released under a Attribution-NonCommercial-ShareAlike 3.0 License.