export class CmUtils {

    static isEmpty(value: any): boolean {
        return !value && value != 0 && value !== false
    }

    static isNotEmpty(value: any): boolean {
        return !this.isEmpty(value)
    }

    /**
     * 返回[分隔符]最后出现后的子字符串。
     * @param delimiter 分隔符
     * @param text
     */
    static substringAfterLast(delimiter: string, text: string): string {
        const index = text.lastIndexOf(delimiter)
        if (index == -1) {
            return text
        } else {
            return text.substring(index + 1, text.length)
        }
    }

}
