-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathString1.java
More file actions
52 lines (26 loc) · 991 Bytes
/
String1.java
File metadata and controls
52 lines (26 loc) · 991 Bytes
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
public class String1 {
public static void main(String[] args) {
String s= new String("Gaurav ");
System.out.println(s.length());
System.out.println(s.concat("Jejurkar"));
System.out.println(s.toLowerCase());
System.out.println(s.toUpperCase());
System.out.println("___________________________________________");
String s1= "Yeola";
System.out.println(s.equals(s1));
System.out.println(s1.equals("yeola"));
System.out.println(s1.equalsIgnoreCase("yeola"));
System.out.println(s1.replace('o', 'v'));
System.out.println(s1.trim());
System.out.println(s.substring(3));
System.out.println(s.substring(0, 4));
System.out.println("___________________________________________________________________________");
String s3= "Ram";
String s4= "Ram";
String s5= new String("Ram");
String s6= new String("Ram");
System.out.println(s3==s4);
System.out.println(s5==s6);
//System.out.println(s3.equals(s4));
}
}