Java tutorial
//package com.java2s; public class Main { private static final String DELIM_TIME = ":"; private static String fullFormat(String string) { String[] split = string.split(DELIM_TIME); return minCheck(Integer.valueOf(split[0])) + DELIM_TIME + minCheck(Integer.valueOf(split[1])); } private static String minCheck(int i) { String is = i + ""; if (i < 10) { is = "0" + is; } return is; } }