/**
 * Created by Tony on 2017/7/5.
 * 字符串工具类简化版本
 */

let stringUtil = {
    isEmptyString: function(str) {
        var rst = false;
        if (str == null || str == undefined) {
            rst = true;
        } else if (typeof str) {
            var reg = /^\s*$/;
            rst = reg.test(str);
        }
        return rst;
    },
    convertStrToBoolean: function(str) {
        var rst = false, me = this;
        if (!me.isEmptyString(str)) {
            var upperStr = str.toUpperCase();
            if (upperStr == 'T' || upperStr == 'Y' || upperStr == 'YES' || upperStr == 'TRUE') {
                rst = true;
            }
        }
        return rst;
    }
}
