Here you can find the source of timeToStr(String time)
public static String timeToStr(String time)
//package com.java2s; //License from project: Apache License public class Main { public static String timeToStr(String time) { // List timeList = new ArrayList(); char[] timeArray = time.toCharArray(); char[] timeList = new char[timeArray.length]; int j = 0; for (int i = 0; i < timeArray.length; i++) { if (timeArray[i] == '-' || timeArray[i] == ' ' || timeArray[i] == ':') { continue; } else { timeList[j] = timeArray[i]; j++;/*from ww w .java2 s . c o m*/ } } String thinTime = new String(timeList); return thinTime.trim(); } }