@jlhv/string-helper
Version:
A simple utility library for string manipulation.
31 lines (30 loc) • 1.76 kB
TypeScript
/**
* String Helper Library
* Provides various string manipulation functions
*/
export declare function capitalize(str: string): string;
export declare function toLowerCase(str: string): string;
export declare function toUpperCase(str: string): string;
export declare function trim(str: string): string;
export declare function reverse(str: string): string;
export declare function toCamelCase(str: string): string;
export declare function toKebabCase(str: string): string;
export declare function toSnakeCase(str: string): string;
export declare function slugify(str: string): string;
export declare function isValidEmail(email: string): boolean;
export declare function isValidURL(url: string): boolean;
export declare function contains(str: string, substring: string): boolean;
export declare function repeat(str: string, count: number): string;
export declare function replaceAll(str: string, search: string, replacement: string): string;
export declare function truncate(str: string, maxLength: number): string;
export declare function countOccurrences(str: string, substring: string): number;
export declare function countWords(str: string): number;
export declare function maskString(str: string, visibleChars?: number, maskChar?: string): string;
export declare function removeAllWhitespace(str: string): string;
export declare function removeSpecialCharacters(str: string): string;
export declare function extractNumbers(str: string): string;
export declare function obfuscateEmail(email: string): string;
export declare function generateRandomString(length: number): string;
export declare function swapCase(str: string): string;
export declare function isAlphanumeric(str: string): boolean;
export declare function isTitleCase(str: string): boolean;