import java.lang.StringBuffer.*;
class Stringbuffer
{
public static void main(String[] args)
{
StringBuffer sb=new StringBuffer("hello am san");
System.out.println("given string is :----"+sb);
System.out.println("appending str---"+sb.append(" hi "));
System.out.println("insert z at 10 postion---"+sb.insert(10,'x'));
System.out.println("delete at 5 to 10 posiotion---"+sb.delete(5,10));
System.out.println("reverse-------"+sb.reverse());
System.out.println("to srting ---"+sb.toString());
System.out.println("length of str---"+sb.length());
System.out.println("delete at 5 to10 posiotion---"+sb.delete(5,10));
}
}
No comments:
Post a Comment