var result = arguments[0].replace(reg, function($0, $1) {
return args[parseInt($1) + 1];
});
return result;
};
// 数字补零
Number.prototype.LenWithZero = function(oCount) {
var strText = this.toString();
while (strText.length < oCount) {
strText = '0' + strText;
}
return strText;
};
// Unicode还原
Number.prototype.ChrW = function() {
return String.fromCharCode(this);
};
// 数字数组由小到大排序
Array.prototype.Min2Max = function() {
var oValue;
for (var i = 0; i < this.length; i++) {
for (var j = 0; j <= i; j++) {
if (this[i] < this[j]) {
oValue = this[i];
this[i] = this[j];
this[j] = oValue;
}
}
}
returnthis;
};
// 数字数组由大到小排序
Array.prototype.Max2Min = function() {
var oValue;
for (var i = 0; i < this.length; i++) {
for (var j = 0; j <= i; j++) {
if (this[i] > this[j]) {
oValue = this[i];
this[i] = this[j];
this[j] = oValue;
}
}
}
returnthis;
};
// 获得数字数组中最大项
Array.prototype.GetMax = function() {
var oValue = 0;
for (var i = 0; i < this.length; i++) {
if (this[i] > oValue) {
oValue = this[i];
}
}
return oValue;
};
// 获得数字数组中最小项
Array.prototype.GetMin = function() {
var oValue = 0;
for (var i = 0; i < this.length; i++) {
if (this[i] < oValue) {
oValue = this[i];
}
}
return oValue;
};
// 获取当前时间的中文形式
Date.prototype.GetCNDate = function() {
var oDateText = '';
oDateText += this.getFullYear().LenWithZero(4) + new Number(24180).ChrW();
oDateText += this.getMonth().LenWithZero(2) + new Number(26376).ChrW();
oDateText += this.getDate().LenWithZero(2) + new Number(26085).ChrW();
oDateText += this.getHours().LenWithZero(2) + new Number(26102).ChrW();
oDateText += this.getMinutes().LenWithZero(2) + new Number(20998).ChrW();
oDateText += this.getSeconds().LenWithZero(2) + new Number(31186).ChrW();
oDateText += new Number(32).ChrW() + new Number(32).ChrW() + new Number(26143).ChrW() + new Number(26399).ChrW() + new String('26085199682010819977222352011620845').substr(this.getDay() * 5, 5).ToInt().ChrW();
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· AI与.NET技术实操系列(二):开始使用ML.NET
· 记一次.NET内存居高不下排查解决与启示
· 探究高空视频全景AR技术的实现原理
· 理解Rust引用及其生命周期标识(上)
· 浏览器原生「磁吸」效果!Anchor Positioning 锚点定位神器解析
· DeepSeek 开源周回顾「GitHub 热点速览」
· 物流快递公司核心技术能力-地址解析分单基础技术分享
· .NET 10首个预览版发布:重大改进与新特性概览!
· AI与.NET技术实操系列(二):开始使用ML.NET
· .NET10 - 预览版1新功能体验(一)