String.prototype.anchor(<name>) Creates an <a> HTML anchor element that is used as a hypertext target.

String.prototype.indexOf(<searchValue>,<fromIndex>) Returns the index within the calling String object of the first occurrence of the specified value, starting the search at fromIndex. Returns -1 if the value is not found.

String.prototype.replace(<pattern|substring>,<replacementString>) Return a new string with some or all matches of a pattern replaced by a replacement.

String.prototype.slice(<beginSlice>,<endSlice>) Extracts a section of a string and returns a new string. beginSlice = The zero-based index at which to begin extraction. If negative, it is treated as sourceLength + beginSlice where sourceLength is the length of the string. endSlice = The zero-based index at which to end extraction. If omitted, slice() extracts to the end of the string. If negative, treated as sourceLength - endSlice.

Facts, Thoughts and Opinions

String comparator function

function stringCompare(a,b) {
    if (a == b) { return 0; }
    return a > b ? 1 : -1;


  •   Subtopics

  •   Writings

  Sources & Bookmarks