-
Notifications
You must be signed in to change notification settings - Fork 0
/
StringFunction.java
33 lines (20 loc) · 1018 Bytes
/
StringFunction.java
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
class StringFunction
{
public static void main(String args[])
{
String name = "Every thing is Possible ";
String name2 = "Just Belive in your Self";
System.out.println("String Length :"+ name.length());
System.out.println("String UpperCase :"+ name.toUpperCase());
System.out.println("String LowerCase :"+ name.toLowerCase());
System.out.println("String Character at Position :"+ name.charAt(2));
System.out.println("String Last Index :" + name.lastIndexOf("e"));
System.out.println("String concat :"+ name.concat(" just Belive in our Self."));
System.out.println("String Substring :"+name.substring(15));
System.out.println("String Equal :"+ name.equals("just Belive in our Self."));
System.out.println("Stirng trime :"+ name.trim());
//System.out.println("String Start with :"+ name.startWith("E"));
//System.out.println("String EndWith :"+ name.endWith("l"));
System.out.println("String Replace :"+ name.replace("Every thing is Possible","Just Belive in your Self"));
}
}