chg: String.startsWith() method is already provided by Rhino

This commit is contained in:
Tobi Schäfer 2020-03-21 10:27:50 +01:00
parent 2a4ae9adcf
commit 9f49ad80b9

View file

@ -398,23 +398,6 @@ String.prototype.md5 = function() {
};
/**
* function returns true if the string starts with
* the string passed as argument
* @external
* @memberof {String}
* @param String string pattern to search for
* @return Boolean true in case it matches the beginning
* of the string, false otherwise
*/
String.prototype.startsWith = function(str, offset) {
var javaObj = new java.lang.String(this);
if (offset != null)
return javaObj.startsWith(str, offset);
return javaObj.startsWith(str);
};
/**
* function returns true if the string ends with
* the string passed as argument