The `typescript-string-operations` library (current stable v1.6.1) provides a collection of lightweight, utility functions for common string manipulations in TypeScript, inspired by C# string operations. It includes robust `formatString` with specifiers (e.g., `{0:L}` for lowercase, `{0:d}` for short date), `joinString` for concatenating arrays or objects with a delimiter, `isNullOrWhiteSpace` for comprehensive empty/null/whitespace checks, and an `emptyString` constant. A `StringBuilder` class is also available for efficient, mutable string construction, mirroring its C# counterpart. The library is designed to be lightweight, has no jQuery dependency, and is unit-tested, making it suitable for modern web applications, including those built with Angular. Its release cadence is feature-driven, with notable breaking changes in version 1.5.0, where uppercase-prefixed methods and the `String` class were deprecated in favor of named function imports to avoid polluting the global `String` object.
npm install typescript-string-operationsVerified import paths — ran on the pinned version, not inferred.
Demonstrates installation, importing key functions and the StringBuilder class, and basic usage of `emptyString`, `isNullOrWhiteSpace`, `formatString` (with indexed arguments and object specifiers), `joinString` (with variadic arguments, arrays, and objects), and `StringBuilder` methods.
Migrate to the new lowercase-prefixed named function exports like `formatString`, `joinString`, `isNullOrWhiteSpace`, and `emptyString`.
Avoid importing `String` (e.g., `import { String } from 'typescript-string-operations'`). Instead, use direct named imports for individual utility functions and constants.Ensure your project's TypeScript version is compatible with the version used by `typescript-string-operations` v1.5.0 or newer. Review compiler options and update your `tsconfig.json` if necessary.
It is strongly recommended to use the individual named function exports (`formatString`, `isNullOrWhiteSpace`, etc.) even in older versions if possible, to avoid global object modification. If upgrading to v1.5.0+, ensure the `String` class import is removed.
No dependency data recorded yet.