public class Main { public static void main(String[] arg) { StringBuffer buf = new StringBuffer("::"); char[] text = { 'i', 's', ' ', 'e', 'x', 'a', 'c', 't', 'l', 'y' }; buf.append(text, 2, 8); System.out.println(buf); } }