Java StringBuilder.insert(int offset, char c)
Syntax
StringBuilder.insert(int offset, char c) has the following syntax.
public StringBuilder insert(int offset, char c)
Example
In the following code shows how to use StringBuilder.insert(int offset, char c) method.
public class Main {
public static void main(String args[]) {
StringBuilder buffer = new StringBuilder();
// w w w . ja va2 s.c om
char characterValue = 'K';
buffer.insert(0, characterValue);
System.out.println(buffer.toString());
}
}
The code above generates the following result.