-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPrgm.java
31 lines (19 loc) · 893 Bytes
/
Prgm.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
package questions;
public class Prgm {
public static void main(String args[])
{
String name = "Shweta Raju Odel";
System.out.println("length of a string=" +name.length());
System.out.println("Convert to lowercase=" +name.toLowerCase());
System.out.println("Convert to lowercase=" +name.toUpperCase());
System.out.println("Check position=" +name.indexOf("Raju")); //Count starts from zero
String txt = "Hello";
System.out.println("Concat Two Strings= " +txt + "," + name);
System.out.println("Concat Two Strings= " +(txt).concat(name));
//System.out.println("core "java" programs"); =this will give error.
//to avoid this problem use Backslash escape character
System.out.println("core \"java\" programs");
System.out.println("core \'java\' programs");
System.out.println("core \\java\\ programs");
}
}