StringBuffer.append(CharSequence s, int start, int end) has the following syntax.
public StringBuffer append(CharSequence s, int start, int end)
In the following code shows how to use StringBuffer.append(CharSequence s, int start, int end) method.
public class Main { //from w ww. ja v a 2 s . c o m public static void main(String[] arg) { StringBuffer buffer = new StringBuffer(); CharSequence cs = "java2s.com"; buffer.append(cs,1,2); System.out.println(buffer); } }
The code above generates the following result.