II B.Tech II Sem CSE Java Lab Exercise - 2 d(Operations, Expressions, Control-flow, Strings)

d) Implementing StringBuffer

Aim: To write a JAVA program using StringBuffer to delete, remove character

Description:





Program:

class stringbufferdemo 
{
public static void main(String[] args) 
{
StringBuffer sb1 = new StringBuffer("Hello Gandi");
sb1.delete(0,6);
System.out.println(sb1);
StringBuffer sb2 = new StringBuffer("Some Content"); 
System.out.println(sb2);
sb2.delete(0, sb2.length()); 
System.out.println(sb2);
StringBuffer sb3 = new StringBuffer("Hello Netaji"); 
sb3.deleteCharAt(0);
System.out.println(sb3);
}
}

Output:


No comments

File Uploading in PHP

  File Uploading in PHP PHP allow you to upload any type of a file i.e. image, binary or text files.etc..,PHP has one in built global variab...