Core

From CCIL
Revision as of 08:23, 15 April 2017 by Atanas.ilchev (Talk | contribs) (Created page with " === Include === ==== Maven ==== <pre> </pre> === API === ==== String Prototypes ==== ===== contains ===== <pre> String.prototype.contains = function(str, ignoreCase) {...")

(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Jump to: navigation, search


Include

Maven


API

String Prototypes

contains
String.prototype.contains = function(str, ignoreCase) {
	  return (ignoreCase ? this.toUpperCase() : this)
	    .indexOf(ignoreCase ? str.toUpperCase() : str) >= 0;
};
endsWith
String.prototype.endsWith = function(suffix) {
	return this.indexOf(suffix, this.length - suffix.length) !== -1;
};
replaceAll
String.prototype.replaceAll = function(search, replacement) {
	var target = this;
	return target.replace(new RegExp(search, 'g'), replacement);
};