forked from serkanhelvacioglu/Java-IAU
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathString
More file actions
31 lines (23 loc) · 958 Bytes
/
String
File metadata and controls
31 lines (23 loc) · 958 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 static void main(String[] args) {
String word1 = "JAVA";
String word2 = "CSharp";
String word3 = "Object Oriented Programming";
char[] array1 = new char [4];
System.out.println(word1.charAt(3));
System.out.println(word1.contains("va"));
System.out.println(word1.equals(word2));
System.out.println(word1.indexOf("C"));
System.out.println(word1.isEmpty());
System.out.println(word1.lastIndexOf("A"));
System.out.println(word3.replace(" ", " - "));
System.out.println(word3);
System.out.println(word3.startsWith("O"));
System.out.println(word1.substring(0));
System.out.println(word1.substring(0, 2));
System.out.println(word1.toCharArray());
array1=word1.toCharArray();
System.out.println(array1[0]);
System.out.println(word1.toLowerCase());
System.out.println(word1.toUpperCase());
System.out.println();
}