-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstring.java
More file actions
31 lines (19 loc) · 794 Bytes
/
string.java
File metadata and controls
31 lines (19 loc) · 794 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
public class string {
public static void main(String[] args) {
String name= "Rohan";
System.out.println(name);
System.out.println(name.length());
String toloweString =name.toLowerCase();
System.out.println(toloweString);
String toupper =name.toUpperCase();
System.out.println(toupper);
System.out.println(name.trim());
System.out.println(name.substring(2,4));
System.out.println(name.replace('R', 'm'));
System.out.println(name.replace("Roh", "soh"));
System.out.println(name.startsWith("Roh", 0));
System.out.println(name.endsWith("lr"));
System.out.println(name.charAt(3));
System.out.println(name.indexOf("R"));
}
}