StringBuffer deleteCharAt (int index): This method deletes the character at the specified position index from the string buffer. For example,
StringBuffer s1= new StringBuffer (“Helloo Java”);
str.deleteCharAt(4);
As a result, the character at the index 1 from the string buffer will be deleted and will now contain “Hello Java”.
public class StringBufferdeleteCharAt
{
public static void main(String[] args)
{
StringBuffer s1 = new StringBuffer("Helloo Java");
s1.deleteCharAt(4);
System.out.println("s1 : " + s1);
}
}