MiaoScript/src/main/resources/core/patch/String.js

15 lines
439 B
JavaScript
Raw Normal View History

2017-12-28 08:28:13 +00:00
/**
* 补丁和方法扩展
*/
(function() {
2017-12-28 08:28:13 +00:00
// Java格式化方法
var str = Java.type('java.lang.String');
String.prototype.format = function() {
2017-12-28 08:28:13 +00:00
return str.format(this, Array.prototype.slice.call(arguments, 0))
};
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
})();