Skip to main content

Crate philiprehberger_str_utils

Crate philiprehberger_str_utils 

Source
Expand description

String manipulation utilities — truncation, case conversion, padding, and whitespace operations.

This crate provides a StrExt trait that extends &str and String with convenient string manipulation methods.

§Usage

use philiprehberger_str_utils::StrExt;

assert_eq!("Hello, World!".truncate_ellipsis(8), "Hello...");
assert_eq!("hello world".to_camel_case(), "helloWorld");
assert_eq!("hi".pad_left(5, ' '), "   hi");
assert_eq!("  hello   world  ".squish(), "hello world");

Traits§

StrExt
Extension trait providing string manipulation methods.