Registry / utility / textwrap

textwrap

JSON →
library0.16.2rscratesunverified

Library for word wrapping, indenting, and dedenting strings. Has optional support for Unicode and emojis as well as machine hyphenation.

# Cargo.toml [dependencies] textwrap = "0.16.2"
INSTALL
IMPORT
SIG · TEXTWRAP
T
textwrap
utilityrustv0.16.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

wrap
✓ use textwrap::wrap;

Wrap a string to a specified width.

use textwrap::wrap; let wrapped = wrap("Hello world, this is a long line.", 10); for line in wrapped { println!("{}", line); }
Debug
Known issues
gotchaUnicode support requires the `unicode-width` feature.
fix
Add `features = ["unicode-width"]` to your Cargo.toml dependency.
affects: >=0.16.0
Upgrade
Version history
0.16.2latest on crates.io
Audit
Dependencies

No dependency data recorded yet.

Agent activity
12 hits · last 30 days
node
12
Resources
textwrap — cargo add textwrap · libregistry