What is the easiest way to pad a string with 0 to the left so that
"110" = "00000110"
"11110000" = "11110000"
I have tried to use the format!
macro but it only pads to the right with space:
format!("{:08}", string);
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…