I'm trying to concatenate two strings (&str
) or convert a byte array in a string in Rust without using std. I saw core::str::from_utf8
but that's not what I'm looking for.
I'm searching something like
let b: [u8; 2] = [97, 98];
let result: &str = core::str::array_to_string(b); // "ab"
or
let a: &str = "Hello ";
let b: &str = "world !";
let result: &str = core::str::concatenate(a, b);