- Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStringbuffer.java
More file actions
Latest commit
22 lines (21 loc) · 573 Bytes
/
Copy pathStringbuffer.java
File metadata and controls
22 lines (21 loc) · 573 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
/**
*
* @author Mudassar
*/
publicclassStringbuffer {
publicstaticvoidmain(Stringargs[])
{
StringBuffersb=newStringBuffer("Hello world");
System.out.println("Original word:"+sb);
sb.replace(0,5,"Hi");
System.out.println("Modified word:"+sb);
sb.delete(0,8);
System.out.println(sb);
sb.delete(0,sb.length());
System.out.println(sb);
StringBuffersb1=newStringBuffer("Abutalha");
System.out.println(sb1);
sb1.deleteCharAt(0);
System.out.println(sb1);
}
}