Difference between revisions of "Core"
From CCIL
(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
Contents
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); };