Crates.io | multiline-str |
lib.rs | multiline-str |
version | 0.1.1 |
source | src |
created_at | 2024-06-04 18:30:40.700973 |
updated_at | 2024-06-04 18:36:56.781033 |
description | A simple multiline string Rust macro, which allows you to write multiline strings in a more readable way. It allows for any combination of space-joined and newline-joined strings. |
homepage | |
repository | https://github.com/acovaci/multiline-str-rust-macro |
max_upload_size | |
id | 1261907 |
size | 8,887 |
This is a simple multiline string Rust macro, which allows you to write multiline strings in a more readable way. It allows for any combination of space-joined and newline-joined strings.
use multiline_str::multiline_str;
let s = multiline_str! {
"This is a line",
"and this line joins the previous one, with a space",
"and so does this one";
"But this line is separated by a newline",
"and this one joins the previous one, with a space";
"";
"This line is separated by two newlines"
};
println!("{}", s);
Output:
This is a line and this line joins the previous one, with a space and so does this one
But this line is separated by a newline and this one joins the previous one, with a space
This line is separated by two newlines
If you have any suggestions, improvements or bug reports, feel free to open an issue or a pull request. I'm always happy to receive feedback and contributions!
This project is licensed under the MIT license. Refer to the LICENSE file for more information.