$.extend(String.prototype,
{
IsEmpty: function () {
return /^\s*$/.test(this);
},
Equals: function (str, ordinalIgnoreCase) {
ordinalIgnoreCase = ordinalIgnoreCase || false;
if (ordinalIgnoreCase) return $.trim(this.toLowerCase()) === $.trim(str.toLowerCase());
return $.trim(this) === $.trim(str);
},
RealSn: function () {
var sn = $.trim(this.toUpperCase());
if (request("CC").Equals("Lenovo", true)) { //CUSTOMER_CODE
var tmp = sn.substr(0, 2);
if (tmp.Equals("YL", true)) {
return sn.substr(0, 8);
}
tmp = sn.substr(sn.length - 8, 2);
if (tmp.Equals("YL", true)) {
return sn.substr(sn.length - 8, 8);
}
}
return sn;
}
});
项目中用到字符串扩展
转载本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
下一篇:继承&修饰符
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
Java-长字符串加密
加密:为你的长字符串提供最高级别的保护!!!
加密算法 JAVA -
项目中用到的加密解密工具类
项目中用到的加密解密工具类
java 加密 解密 工具类 -
项目中用到小技术点
一、1. 在ASP.NET中专用属性:获取服务器电脑名:Page.Server.ManchineName获取用户信息:Page.User获取客户端电脑名:P 取出电脑名:static System.Net.Dns.Resolv
asp.net session过期 .net ip地址 javascript