The java.lang.StringBuilder.deleteCharAt() method removes the char at the specified position in this sequence. This sequence is shortened by one char.
Syntax:public StringBuilder deleteCharAt(int index)
Example:/* java example */
import java.lang.*;
public class StringBuilderDemo {
public static void main(String[] args) {
StringBuilder str = new StringBuilder("Java lang package");
System.out.println("string = " + str);
// deleting character from index 4 to index 9
str.delete(4, 9);
System.out.println("After deletion = " + str);
str = new StringBuilder("amit");
System.out.println("string = " + str);
// deleting character at index 2
str.deleteCharAt(2);
System.out.println("After deletion = " + str);
}
}
License.
All information of this service is derived from the free sources and is provided solely in the form of quotations.
This service provides information and interfaces solely for the familiarization (not ownership) and under the "as is" condition.
Copyright 2016 © ELTASK.COM. All rights reserved.
Site is optimized for mobile devices.
Downloads: 718 / 159178537. Delta: 0.00301 с