Entfernen Sie das letzte Zeichen aus StringBuffer
//reference from javapoint
public class RemoveLastCharcter1
{
public static void main(String args[])
{
String string = "Javatpoint is the best educational websites";
//creating a constructor of StringBuffer class
StringBuffer sb= new StringBuffer(string);
//invoking the method
sb.deleteCharAt(sb.length()-1);
//prints the string after deleting the character
System.out.println(sb);
}
}
Output:
Javatpoint is the best educational website
Vinesh Chawan