ez-common-ts/lib/commons/str-utils.d.ts

31 lines
1.5 KiB
TypeScript
Raw Permalink Normal View History

2023-11-10 16:35:59 +08:00
/**
*
*
* @param {RegExp} regExp -
* @param {(text: string, match: boolean) => T} matchHandler -
* @param {(text: string, match: boolean) => T} [textHandler] -
* @return {(str: string) => T[]} -
*/
export declare function stringTokenizer<T>(regExp: RegExp, matchHandler: (text: string, match: boolean) => T, textHandler?: (text: string, match: boolean) => T): (str: string) => T[];
2023-11-11 16:13:36 +08:00
/**
*
*
* undefinedtrue
* false
* @param source
* @param target
* @returns
*/
export declare function equalsIgnoreCase(source: string | undefined, target: string | undefined): boolean;
/**
*
*
* truefalse
* @param list
* @param search
* @returns
*/
export declare const includeIgnoreCase: (list: string[], search: string) => boolean;
2024-01-28 18:30:46 +08:00
export declare const strLength: (str: string) => number;
export declare const strMonospacePad: (str: string, length: number, pad?: string) => string;