export class StringUtil {
    static lowercaseFirst(str) {
        return str.charAt(0).toLowerCase() + str.slice(1);
    }
    static uppercaseFirst(str) {
        return str.charAt(0).toUpperCase() + str.slice(1);
    }
    static replaceAll(str, stringToReplace, replacement, ignoreCase = false) {
        if (!str) {
            return str;
        }
        function replaceAll(src, str1, str2, ignore) {
            return String(src).replace(new RegExp(str1.replace(/([\/\,\!\\\^\$\{\}\[\]\(\)\.\*\+\?\|\<\>\-\&])/g, '\\$&'), (ignore ? 'gi' : 'g')), (typeof (str2) === 'string') ? str2.replace(/\$/g, '$$$$') : str2);
        }
        return replaceAll(str, stringToReplace, replacement, ignoreCase);
    }
    static between(value, prefix, suffix, ignoreCase = false) {
        if (!value) {
            return value;
        }
        function between(s, prefix, suffix) {
            // Usage:  var betweenResult = between('hello you guys','hello ',' guys');
            let i = s.indexOf(prefix);
            if (i >= 0) {
                s = s.substring(i + prefix.length);
            }
            else {
                return '';
            }
            if (suffix) {
                i = s.indexOf(suffix);
                if (i >= 0) {
                    s = s.substring(0, i);
                }
                else {
                    return '';
                }
            }
            return s;
        }
        return between(value, prefix, suffix);
    }
}
//# sourceMappingURL=string-util.js.map