concat-with 0.2.0

Extend the function of the `concat!` macro in `std`.
Documentation

Concat With

Build Status

While the concat! macro in std is useful to create a static string slice (&'static str) from literals, it cannot set a separator for those. This crate therefore provides another concat! macro to deal with that situation.

#[macro_use] extern crate concat_with;

assert_eq!("test10btrue", concat!("test", 10, 'b', true));
assert_eq!("test, 10, b, true", concat!(with ", ", "test", 10, 'b', true));
assert_eq!("test\n10\nb\ntrue", concat_line!("test", 10, 'b', true));

Prefixes and suffixes can also be added.

#[macro_use] extern crate concat_with;

assert_eq!("Someone says: Hello.\nSomeone says: Nice to meet you!", concat_line!(prefix "Someone says: ", "Hello.", "Nice to meet you!"));

Crates.io

https://crates.io/crates/concat-with

Documentation

https://docs.rs/concat-with

License

MIT