Insert string at given index : StringBuffer « Development Class « Java
- Java
- Development Class
- StringBuffer
Insert string at given index
public class Main {
public static void main(String[] argv) throws Exception {
StringBuffer buf = new StringBuffer("Java this is a test");
int index = 5;
buf.insert(index, "Developers ");
System.out.println(buf);
}
}
Related examples in the same category