Check string ends with substr - Node.js String

Node.js examples for String:String End

Description

Check string ends with substr

Demo Code


String.prototype.endsWith = function(suffix)
{
    return (this.substr(this.length - suffix.length) === suffix);
}

Related Tutorials