A comprehensive Go library for string manipulation including case conversion, padding, truncation, and special character handling.
Stringy is a Go library for advanced string manipulation that extends the standard strings package with comprehensive utilities. It solves the problem of complex string transformations like case conversion, padding, truncation, and special character handling that aren't fully covered by Go's native libraries. The package provides a consistent, chainable API for converting between camelCase, snake_case, kebab-case, and other formats while handling edge cases correctly.
Go developers working with text processing, data transformation, API development, or any application requiring sophisticated string manipulation beyond basic operations. Particularly useful for developers handling user input formatting, URL slug generation, or code generation tools.
Developers choose Stringy for its comprehensive feature set, correct handling of edge cases, and chainable API that simplifies complex string transformations. Unlike other Go string libraries, it offers flexible rule-based character omission, multi-byte character support, and seamless conversion between various case formats.
Convert string to camel case, snake case, kebab case / slugify, custom delimiter, pad string, tease string and many other functionalities with help of by Stringy package.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Supports conversions between camelCase, snake_case, kebab-case, PascalCase, and sentence case with customizable omission rules, as shown in examples like CamelCase("?", "", "#", "") for flexible formatting.
Most functions return a StringManipulation interface, enabling seamless chaining like str.SnakeCase().ToUpper().Get(), which simplifies complex string transformations in a readable way.
Handles Unicode and multi-byte characters correctly in functions such as Substring, with examples like extracting "世界" from "Hello 世界", ensuring robust international text support.
Includes padding, truncation, slug generation with counters (e.g., SlugifyWithCount), and special character removal, filling gaps in Go's native string handling for diverse use cases.
Functions like CamelCase and SnakeCase use variadic rule parameters for character omission, which can be confusing and error-prone, as users must understand the syntax to pass rules correctly.
Some methods like Contains and ReplaceAll are simple wrappers around Go's standard library, adding abstraction without significant benefit for basic operations, potentially bloating code.
The chainable API and additional layers may introduce performance overhead compared to direct string manipulations, especially in loops or high-frequency calls, as noted in the trade-off between convenience and speed.