2017-12-28 08:28:13 +00:00
|
|
|
/**
|
|
|
|
* 补丁和方法扩展
|
|
|
|
*/
|
2019-09-01 15:58:07 +00:00
|
|
|
(function() {
|
2017-12-28 08:28:13 +00:00
|
|
|
// Java格式化方法
|
|
|
|
var str = Java.type('java.lang.String');
|
2019-09-01 15:58:07 +00:00
|
|
|
String.prototype.format = function() {
|
2017-12-28 08:28:13 +00:00
|
|
|
return str.format(this, Array.prototype.slice.call(arguments, 0))
|
|
|
|
};
|
2019-09-01 15:58:07 +00:00
|
|
|
var indexOf = String.prototype.indexOf;
|
|
|
|
String.prototype.contains = function(searchString/*, position*/) {
|
|
|
|
return indexOf.call(this, searchString, arguments[1]) > -1;
|
|
|
|
};
|
2017-12-28 08:28:13 +00:00
|
|
|
})();
|