Node.js examples for String:String End
Check if given string ends with pattern.
String.prototype.endsWith = function(pattern) { var d = this.length - pattern.length; return d >= 0 && this.lastIndexOf(pattern) === d; };