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:
S
Shyam Dubey     View Profile
If you are good in any field. Just share your knowledge with others.