// Program to explain the following StringBuffer function :
// StringBuffer replace( int startIndex, int endIndex, String str )class Mreplace1
{
public static void main( String args[ ] )
{
StringBuffer sb = new StringBuffer( "Java Programming Examples." );System.out.println( " String = " + sb );
sb = sb.replace( 5, 16, "Language" );System.out.println( " String = " + sb );
}
}
Output:String = Java Programming Examples.
String = Java Language Examples.