java - Fastest way to format a String using concatenation and manipulation -
string temp = ""; temp = string.format("%02d", ""+hour)+":"+string.format("%02d", ""+min)+":"+string.format("%02d", ""+sec);
is fastest way format numbers concatenation specify leading zeroes, or there way?
i have display string in format 00:00:00. hour, min, , sec int variables start 0 , put thread counts time elapsed , displays time accordingly. correct way, or there better way?
try this. assume hour, min , sec ints.
string temp = ""; temp = string.format("%02d:%02d:%02d", hour, min, sec);
Comments
Post a Comment