@azizbecha/strkit
Version:
strkit is a utility library offering a collection of essential string functions including validation, case conversion, truncation, and more. Ideal for both JavaScript and TypeScript developers to simplify string operations in their applications.
16 lines (15 loc) • 499 B
TypeScript
/**
* Removes all spaces from a given string.
*
* This function removes all whitespace characters, including spaces,
* tabs, and newlines, from the input string.
*
* @param str - The input string to process.
* @returns The string with all spaces removed.
*
* @example
* removeSpaces('hello world'); // "helloworld"
* removeSpaces(' this is a test '); // "thisisatest"
* removeSpaces('\nhello\tworld '); // "helloworld"
*/
export default function removeSpaces(str: string): string;