The snippet library.
Small, practical examples. Search by task or narrow things down below.
Compare ASCII text ignoring case
Compare ASCII text ignoring case in a complete Rust program using the standard library.
Rust✓ Tested
Distinguish UTF-8 bytes from characters
Distinguish UTF-8 bytes from characters in a complete Rust program using the standard library.
Rust✓ Tested
Join string slices
Join string slices in a complete Rust program using the standard library.
Rust✓ Tested
Remove a prefix only when it matches
Remove a prefix only when it matches in a complete Rust program using the standard library.
Rust✓ Tested
Replace a literal substring
Replace a literal substring in a complete Rust program using the standard library.
Rust✓ Tested
Split a key-value pair once
Split a key-value pair once in a complete Rust program using the standard library.
Rust✓ Tested
Split on Unicode whitespace
Split on Unicode whitespace in a complete Rust program using the standard library.
Rust✓ Tested
Take Unicode characters without byte slicing
Take Unicode characters without byte slicing in a complete Rust program using the standard library.
Rust✓ Tested
Trim whitespace around text
Trim whitespace around text in a complete Rust program using the standard library.
Rust✓ Tested