StringBuilder.delete(int start, int end) has the following syntax.
public StringBuilder delete(int start, int end)
In the following code shows how to use StringBuilder.delete(int start, int end) method.
public class Main { public static void main(String[] argv) { StringBuilder sb = new StringBuilder(); sb.append(true);// www . ja v a 2s. c om sb.append("java2s.com"); sb.delete(1, 2); System.out.println(sb.toString()); } }
The output: