macro_rules! str_concat {
($($x:expr),*) => { ... };
(str = $str:expr; $($x:expr),*) => { ... };
(cap = $cap:expr; $($x:expr),*) => { ... };
(sep = $sep:expr; $($x:expr),*) => { ... };
}
๐Deprecated since 0.8.0-rc.1: Use
string_v2
instead, v1 will be removed in 0.9.0.Expand description
Fast concat String
/ &str
/ number.
For details of params accepted, please refers to StringExtT
.
ยงExamples
// General usage
assert_eq!(
str_concat!(
NumStr::hex_default(0xa_usize), // HexStr
"b", // &str
"c".to_string(), // String
1u8, // single number
'๐', // char
'๏ฟฝ' // char
), "abc1๐๏ฟฝ"
);
// with initial string
assert_eq!(
str_concat!(str = "abc"; "1", "๐", "๏ฟฝ"), "abc1๐๏ฟฝ"
);
// with capacity
assert_eq!(
str_concat!(cap = 10; "abc", "1", "๐", "๏ฟฝ"), "abc1๐๏ฟฝ"
);
// with separator
assert_eq!(
str_concat!(sep = ","; "abc", "1", "๐", "๏ฟฝ"), "abc,1,๐,๏ฟฝ"
);