multiline-str

Crates.iomultiline-str
lib.rsmultiline-str
version0.1.1
sourcesrc
created_at2024-06-04 18:30:40.700973
updated_at2024-06-04 18:36:56.781033
descriptionA 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
repositoryhttps://github.com/acovaci/multiline-str-rust-macro
max_upload_size
id1261907
size8,887
Adrian Covaci (acovaci)

documentation

README

Multiline str macro

Crates.io License Crates.io Version Crates.io Downloads

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.

Usage

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

Contributing

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!

License

This project is licensed under the MIT license. Refer to the LICENSE file for more information.

Commit count: 7

cargo fmt