Delete and replace and reverse

ReturnMethodSummary
StringBuilderdelete(int start, int end)Removes the characters in a substring of this sequence.
StringBuilderdeleteCharAt(int index)Removes the char at the specified position in this sequence.
StringBuilderreplace(int start, int end, String str)Replaces the characters in a substring of this sequence with characters in the specified String.
StringBuilderreverse()Causes this character sequence to be replaced by the reverse of the sequence.

public class Main {
  public static void main(String[] argv) {
    StringBuilder sb = new StringBuilder();
    sb.append("java2s.com");

   
    sb.deleteCharAt(0);
    
    System.out.println(sb.toString());

  }
}

The output:


ava2s.com
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.