Javascript String finish(finish)
String.prototype.finish = function(finish) { if (this.endsWith(finish)) { return this.toString(); } else {/*from ww w . j a v a 2s . co m*/ return this + finish; } };