Thursday, February 20, 2014

Example of StringBuffer replace method in java.

public class StringBufferReplaceMethod
{
public static void main(String surat[])
{
StringBuffer sb = new StringBuffer();
sb.append("CandyFry Developers");

System.out.println("Original Text : " + sb);

sb.replace(0, 8, "Hello");

System.out.println("Replaced Text : " + sb);
}
}

Output:


No comments:

Post a Comment