-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStringFunctions.java
More file actions
72 lines (55 loc) · 1.92 KB
/
Copy pathStringFunctions.java
File metadata and controls
72 lines (55 loc) · 1.92 KB
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package org.stringClass;
public class StringFunctions {
static String my_String =" Integrated Decisions And Systems " ;
public String stringCase(String str)
{
str=my_String;
System.out.println("Sting Case Functions - toLowerCase & toUpperCase :");
String str1=my_String.toLowerCase();
System.out.println(my_String.toLowerCase());
System.out.println(my_String.toUpperCase());
return str1;
}
public String strTrim(String str)
{str=my_String;
System.out.println("\n String Trim Function : trims spaces before and after string");
System.out.println(my_String.trim());
String str1=my_String.trim();
return str1;
}
public boolean strStartEnd(String str)
{str=my_String;
System.out.println("\n Check Start or End of String : startsWith or EndsWith Functions");
boolean str1=my_String.startsWith(" Int");
System.out.println(my_String.startsWith(" Int"));
System.out.println(my_String.endsWith("Pune"));
return str1;
}
public char strCharAt(String str)
{ str = my_String;
System.out.println("Display Character at certain postion using charAt function");
char c = my_String.charAt(10);
System.out.println(my_String.charAt(10));
return c;
}
public String subString(String str)
{
str = my_String;
System.out.println("Substring From index 10 :"+my_String.substring(10));
System.out.println("Substring From index 25 to 35 :"+my_String.substring(25, 35));
return (my_String.substring(25, 35));
}
public static void main(String[] args) {
System.out.println("Original Input String : "+my_String);
StringFunctions sc = new StringFunctions();
sc.stringCase(my_String);
StringFunctions st = new StringFunctions();
st.strTrim(my_String);
StringFunctions sse = new StringFunctions();
sse.strStartEnd(my_String);
StringFunctions sca = new StringFunctions();
sca.strCharAt(my_String);
StringFunctions sub = new StringFunctions();
sub.subString(my_String);
}
}