String.prototype.startsWith = function (startStr) {  var d = startStr.length;  return (d >= 0 && this.indexOf(startStr) == 0) }

 

String.prototype.endsWith = function (endStr) {  var d = this.length - endStr.length;  return (d >= 0 && this.lastIndexOf(endStr) == d) }

 

String.prototype.LTrim = function()
{
         return this.replace(/(^s*)/g, "");
}

String.prototype.Rtrim = function()
{
         return this.replace(/(s*$)/g, "");
}

String.prototype.Trim = function()
{
         return this.replace(/(^s*)|(s*$)/g, "");
}

String.prototype.Left = function(len)
{
         if(isNaN(len)||len==null)
         {
                 len = this.length;
         }
         else
         {
                 if(parseInt(len)<0||parseInt(len)>this.length)
                 {
                         len = this.length;
                 }
         }
         return this.substr(0,len);
}

String.prototype.Right = function(len)
{
         if(isNaN(len)||len==null)
         {
                 len = this.length;
         }
   

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-02-15
  • 2022-12-23
  • 2021-10-09
猜你喜欢
  • 2022-12-23
  • 2021-12-29
  • 2022-12-23
  • 2021-11-13
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案