日期:2014-05-20 浏览次数:20693 次
public class Test6 { /** * @param args */ public static void main(String[] args) { String str = "123"; System.out.println(strConvert(str)); } public static String strConvert(String source){ String object = ""; char[] sArray = source.toCharArray(); for (int i = 0; i < sArray.length; i++) { object += Character.toString(sArray[i]) + ","; } return object.substring(0,object.lastIndexOf(",")); } }