Copy char array to string
public class Main {
public static void main(String[] args) {
char[] data = { 'a', 'b', 'c', 'd', 'e', 'f', 'g', 'h', 'i', 'j' };
String text = String.valueOf(data);
System.out.println(text);
text = String.copyValueOf(data, 3, 5);
System.out.println(text);
}
}
Related examples in the same category