Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVA

remove last character from 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
 
PREVIOUS NEXT
Tagged: #remove #character #stringbuffer
ADD COMMENT
Topic
Name
4+2 =