-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathInbuild.java
More file actions
76 lines (49 loc) · 1.83 KB
/
Inbuild.java
File metadata and controls
76 lines (49 loc) · 1.83 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
/// Lets Run the inbuild lireries and make operation on it
import java.util.*;
public class Inbuild
{
public static void main(String[] args)
{
String s,s2;
Scanner sc=new Scanner(System.in);
System.out.println("ENter the Original StringS: \t");
s=sc.nextLine();
System.out.println("Enter the 2nd String for Operation:\t");
s2=sc.nextLine();
StringBuffer sb=new StringBuffer(s);
sb.append(s2);
System.out.println(" "+sb+" ");
System.out.println(" ");
System.out.println(" Now CONTAINS");
System.out.println(" "+s.contains(s2));
System.out.println(" = ");
System.out.println(" "+s.equals(s2));
//System.out.println(" charAt ");
// System.out.println(" uSE IF cHAR sTRING"));
System.out.println("EndsWith ");
System.out.println(" "+s.endsWith("y"));
System.out.println(" IndexOf ");
System.out.println(" "+s2.indexOf("o"));
System.out.println(" ");
System.out.println("toLowerCAse ");
System.out.println(" "+s2.toLowerCase());
System.out.println(" ");
System.out.println(" isEnpty ");
System.out.println(" "+s.isEmpty());
System.out.println(" ");
System.out.println(" subString use when CharArray String");
//System.out.println(" "+sub.String("y"));
System.out.println(" ");
System.out.println(" Replace ");
System.out.println(" "+s2.replace("roy","Ravi"));
System.out.println(" ");
System.out.println(" Delete ");
//System.out.println(" "+s2.delete("r"));
System.out.println(" ");
System.out.println(" getByteCode and HashCode ");
System.out.println(" "+s2.getBytes()+" "+s.hashCode());
System.out.println(" ");
System.out.println(" Replace All ");
System.out.println(" "+s.replaceAll(s,s2));
}
}