The difference between substring(), substr() and slice() in javascript, Programmer Sought, the best programmer technical posts sharing site.
toLowerCase(); var sub = h.substring(h.length - d.length, h.length); if (sub == d) return true; return false; } function localHostOrDomainIs(host, hostdom) { var h1
Definition and Usage. The substr () method extracts parts of a string, beginning at the character at the specified position, and returns the specified number of characters. Tip: To extract characters from the end of the string, use a negative start number (This does not work in IE 8 and earlier). Se hela listan på developer.mozilla.org Try the following example. Live Demo.