3:37 pm - Friday September 21, 1917

StringBuilder Example Program for append(CharSequence s, int start,int end)

CANDID INDUSTRIAL TRAINING -- CHENNAI
Corporate Training for Experienced Candidate
Struts | Hibernate | Spring | Java / J2EE
SOAP | RestFull | Design Pattern | more...
Ph: +91 72000 69003
137b, 2nd st, shanthi nagar, Chrompet, Chennai -600044
/**
*@author :CandidJava.com
*@descriptions : This program explain the function and use of  append(CharSequence s, int start,int end). This function used to  append specified character sequence as per given the index and length value
*/

import java.lang.*;
public class StrBuilderappendEx
{
public static void main(String args[])
{
StringBuilder sb=new StringBuilder("welcome");//To create object for StringBuilder class
sb.append(sb,0,2);//to append specified character sequence
sb.append(sb,0,3);//to append specified character sequence
sb.append(sb,0,4);//to append specified character sequence
sb.append(sb,0,7);//to append specified character sequence
sb.append(sb,1,2);//to append specified character sequence
sb.append(sb,1,3);//to append specified character sequence
sb.append(sb,1,7);//to append specified character sequence
System.out.println(sb);
}
}

Output:

welcomewewelwelcwelcomeeelelcome

BACK

Filed in: Z-A All Java Codes

Comments are closed.