Crates.io | stripmargin |
lib.rs | stripmargin |
version | 0.1.1 |
source | src |
created_at | 2021-01-16 19:59:48.104327 |
updated_at | 2021-01-17 10:37:16.584115 |
description | Simple but elegant multiline string in Rust à la Scala. |
homepage | https://github.com/rami3l/stripmargin |
repository | https://github.com/rami3l/stripmargin |
max_upload_size | |
id | 342916 |
size | 6,090 |
A little Rust library that enables you to write multiline strings à la Scala.
use stripmargin::StripMargin;
// Use '|' to set left margin,
// and then `.strip_margin()` :)
```rust
assert_eq!(
r#"Hello,
| world!
|"#
.strip_margin(),
"Hello,\n world!\n",
);