-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMethod_Of_String.java
More file actions
24 lines (23 loc) · 964 Bytes
/
Method_Of_String.java
File metadata and controls
24 lines (23 loc) · 964 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
package com.company;
public class Method_Of_String {
public static void main(String[] args) {
String a="Rahul";
// System.out.println(a.length());
// System.out.println(a.toUpperCase());
// System.out.println(a.toLowerCase());
// String name=" rahul ";
// System.out.println(name.trim());
// System.out.println(a.substring(0));
// System.out.println(a.substring(0,3));
// System.out.println(a.replace("R","H"));
// System.out.println(a.startsWith("R"));
// System.out.println(a.endsWith("l"));
// System.out.println(a.charAt(2));
// System.out.println(a.indexOf("l"));
// System.out.println(a.indexOf("h",2));
System.out.println(a.lastIndexOf("l"));
System.out.println(a.lastIndexOf("l",4));
System.out.println(a.equals("Rahul"));
System.out.println(a.equalsIgnoreCase("rahul"));
}
}