Here you can find the source of charArrayToString(char[] ch, String separator)
public static String charArrayToString(char[] ch, String separator)
//package com.java2s; //License from project: Apache License public class Main { public static String charArrayToString(char[] ch, String separator) { StringBuffer sb = new StringBuffer(); for (int i = 0; i < ch.length; i++) { sb.append(ch[i]);/*from ww w . jav a2 s . co m*/ if (ch.length != (i + 1)) { sb.append(separator); } } return sb.toString(); } public static String charArrayToString(char[] ch) { return charArrayToString(ch, " "); } }