Comment Comment by steveklabnik The write! macro would be the equivalent here. Something like this: use std::io::Write; static mut S1: [u8; 17] = [0; 17]; fn main() { unsafe { write!(&mut S1[..], "Hi: {}", 5).unwrap(); let s = std::str::from_utf8_unchecked(&S1[..5]); println!("string: {}", s); } } parent steveklabnik 9 years ago