# String Utilities (`str`)

Laravel/AdonisJS-inspired string manipulation with UTF-8 native operations.

## Features

- **Case conversion**: `to_snake_case`, `to_camel_case`, `to_kebab_case`, `to_pascal_case`, etc.
- **Transformations**: `slug`, `truncate`, `squish`, `wrap`, `mask`, `repeat`, `reverse`
- **Inspection**: `is_empty`, `is_ascii`, `is_url`, `contains`, `starts_with`, `ends_with`
- **Pluralization**: `pluralize`, `singular` (feature: `unicode`)
- **Random generation**: `random`, `password` (feature: `random`)
- **Fluent builder**: `Str::of()` chainable API

## Quick Start

```rust
use rok_utils::str::Str;

let result = Str::of("  Hello World  ")
    .trim()
    .to_snake_case()
    .slug()
    .truncate(20)
    .when_empty(|s| s.append("default"))
    .value();
// "hello_world"
```

## Case Conversion

```rust
use rok_utils::{to_snake_case, to_camel_case, to_kebab_case};

let snake = to_snake_case("HelloWorld");    // "hello_world"
let camel = to_camel_case("hello_world");   // "helloWorld"
let kebab = to_kebab_case("HelloWorld");   // "hello-world"
```

## Conditional Transformations

```rust
use rok_utils::str::Str;

Str::of("hello")
    .when(true, |s| s.append(" world"))
    .when_contains("@", |s| s.replace("@", " [at] "))
    .value();
```

## Feature Flags

| Feature | Description |
|---------|-------------|
| `full` | Enable all features |
| `unicode` | Enable pluralization |
| `random` | Enable random string generation |
| `json` | Enable HTML escaping |

## See Also

- [Main examples](../docs/examples.md)
- [Migration guide](../docs/migration-0x-to-1.0.md)
