分享别人写的一个小型js框架

2019-06-02 14:08:53王旭

        this.ltrim = function(){
            var _re, _argument = arguments[0] || " ";
            typeof(_argument)=="string"?(_argument == " "?_re = /(^s*)/g : _re = new RegExp("(^"+_argument+"*)","g")) : _re = _argument;
            return this.replace(_re,"");
        };
        this.rtrim = function(){
            var _re, _argument = arguments[0] || " ";
            typeof(_argument)=="string"?(_argument == " "?_re = /(s*$)/g : _re = new RegExp("("+_argument+"*$)","g")) : _re = _argument;
            return this.replace(_re,"");
        };
        this.concat = function(){
            var s = new StringBuffer();
            s.append(this);
            for (var i=0,j; j=arguments[i]; i++){
                s.append(typeof j=="object" ? j.join("") : j);
            }
            return s.toString();
        };
        this.stripTags = function(){
            return this.replace(/</?[^>]+>/gi, '');
        };
        this.cint = function(){
            return this.replace(/D/g,"")-0;
        };
        this.camelize = function(){
            return this.replace(/(-S)/g,function($1){return $1.toUpperCase().substring(1,2)})
        };
        this.hasSubString = function(s,f){