I have time string coming from an array and I want to add up leading zeros if it is not there for integer values below 10. For example I want
this "8:10:12" to "08:10:12"
this "13:7:14" to "13:07:14"
this "13:25:6" to "13:25:06"
I can go for a really messy code with splitting by ":" and so on, But I would like to know if this can be done with clean code by one line. Just reply if this cannot be done with single line. I'll do the messy code then.
Thanks in advance..!