Use format! to turn chars to string
June 30, 2022
While working on a Rust exercise, at first I did some convoluted way of turning two chars into a string. But it's quite simple with the format! macro: format!("{ch}{next_ch}").
Home > Programming > Blog > Use format! to turn chars to string
June 30, 2022
While working on a Rust exercise, at first I did some convoluted way of turning two chars into a string. But it's quite simple with the format! macro: format!("{ch}{next_ch}").