-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStrings.java
More file actions
25 lines (23 loc) · 866 Bytes
/
Strings.java
File metadata and controls
25 lines (23 loc) · 866 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
package com.company;
import java.util.Locale;
public class Strings {
public static void main(String[] args){
String name = new String("Karman Singh Arora" );
int value = name.length();
String UpperCase = name.toUpperCase();
String lowerCase = name.toLowerCase();
String trim = name.trim();
System.out.println(name);
System.out.println(value);
System.out.println(UpperCase);
System.out.println(lowerCase);
System.out.println(trim);
System.out.println(name.substring(7));
System.out.println(name.substring(0,6));
System.out.println(name.replace('k','A'));
System.out.println(name.startsWith("K"));
System.out.println(name.endsWith("a"));
System.out.println(name.charAt(0));
System.out.println(name.indexOf("a" , 13));
}
}