new StringBuilder(String str) : StringBuilder « java.lang « Java by API






new StringBuilder(String str)

 


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());
  }
}

   
  








Related examples in the same category

1.new StringBuilder(int capacity)
2.StringBuilder: append(char c)
3.StringBuilder: capacity()
4.StringBuilder: delete(int start, int end)
5.StringBuilder: insert(int offset, String str)
6.StringBuilder: reverse()
7.StringBuilder: toString()