StringBuilder.insert(int index, char[] str, int offset, int len) has the following syntax.
public StringBuilder insert(int index, char[] str, int offset, int len)
In the following code shows how to use StringBuilder.insert(int index, char[] str, int offset, int len) method.
public class Main { public static void main(String args[]) { StringBuilder buffer = new StringBuilder(); // ww w. j a v a2 s .c o m char charArray[] = { 'a', 'b', 'c', 'd', 'e', 'f' }; buffer.insert(0, charArray, 3, 3); System.out.println(buffer.toString()); } }
The code above generates the following result.