Remove substring from StringBuilder


public class Main {
  public static void main(String[] args) {
    StringBuilder lipsum = new StringBuilder("Lorem ipsum dolor sit amet.");
    System.out.println("lipsum = " + lipsum.toString());

    lipsum.delete(0, 28);
    System.out.println("lipsum = " + lipsum.toString());

    lipsum.deleteCharAt(lipsum.length() - 1);
    System.out.println("lipsum = " + lipsum.toString());
  }
}
Home 
  Java Book 
    Runnable examples  

StringBuilder:
  1. Check the capacity of StringBuilder object
  2. Delete text from StringBuilder
  3. Palindrome with StringBuilder
  4. Remove substring from StringBuilder