Stringable is a Rust crate that provides a simple and fluent interface for common string manipulations. It aims to make string handling more convenient and readable in Rust.
- Fluent interface for string manipulations
- Easy-to-use methods for common string operations
- Chainable methods for improved readability
Add this to your Cargo.toml
file:
[dependencies]
stringable = "0.1.0"
use stringable::stringable::Stringable;
let original = "This is a test, and it's a good test. ";
let result = Stringable::new(original)
.replace("test", "example")
.to_lowercase()
API documentation is available here.
Here are some of the available methods in the Stringable struct:
new
: Create a new Stringable instanceget_value
: Get the current value of the Stringable instancereplace
: Replace all occurrences of a substring with another substringto_lowercase
: Convert the string to lowercaseto_uppercase
: Convert the string to uppercasetrim
: Trim leading and trailing whitespaceappend
: Append one or more strings to the current stringafter
: Get the substring after the first occurrence of a given valuebefore
: Get the substring before the first occurrence of a given valueafter_last
: Get the substring after the last occurrence of a given value- And more...
This project is licensed under the MIT License.