105
以下代碼格式編號爲固定寬度,帶前導零
a <- seq(1,101,25)
b <- paste("name", 1:length(a), sep = "_")
產生這樣的輸出:
"name_1" "name_26" "name_51" "name_76" "name_101"
我想有所有值的相同寬度,這意味着爲我用這樣的零填充值:
"name_001" "name_026" "name_051" "name_076" "name_101"
我該如何處理?
(此問題被有關this one)