You are here: Home / Topics / stringBuffer delete function in Java

stringBuffer delete function in Java

Filed under: Java on 2023-09-17 06:51:06

// Program to explain the following StringBuffer function :
//StringBuffer delete( int startIndex, int endIndex )

class  Mdelete
{
public static void main( String args[ ] )
{
 StringBuffer sb = new StringBuffer( "Java Programming Examples." );

 System.out.println( " String = " + sb );
 
 sb = sb.delete( 5, 17 );

 System.out.println( " String = " + sb );
}
}


Output:

String = Java Programming Examples.
String = Java Examples.


About Author:
M
Mr. Dubey     View Profile
Founder of MCQ Buddy. I just like to help others. This portal helps students in getting study material free. Share your stuff here so that others can get benefitted.