UNPKG

@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.

21 lines 656 B
"use strict"; /** * 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" */ Object.defineProperty(exports, "__esModule", { value: true }); exports.default = removeSpaces; function removeSpaces(str) { return str.replace(/\s+/g, ''); } //# sourceMappingURL=removeSpaces.js.map