Difference between revisions of "Core"

From CCIL
Jump to: navigation, search
(Created page with " === Include === ==== Maven ==== <pre> </pre> === API === ==== String Prototypes ==== ===== contains ===== <pre> String.prototype.contains = function(str, ignoreCase) {...")
(No difference)

Revision as of 08:23, 15 April 2017


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);
};