chg: String.startsWith() method is already provided by Rhino
This commit is contained in:
parent
2a4ae9adcf
commit
9f49ad80b9
1 changed files with 0 additions and 17 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue