Q:

Java - String Manipulation

0

This Program is used to demonstrate the String Manipulation concept.

All Answers

need an explanation for this answer? contact us directly to get an explanation for this answer

class str1 
{ 
public static void main(String arg[]) 
{ 
String s1 = "Hello World"; 
String s2 = "hello"; 
String s3 = "world"; 
String s4 = "JAVA"; 
String s5 = "programming"; 
String s6 = "hello"; 

System.out.println("\nString : "+s1); 

System.out.println("\nLength : "+s1.length()); 

System.out.println("\nConcatination : "+s2.concat(s3)); 

System.out.println("\nSub String : "+s1.substring(6)); 

System.out.println("\nSub String : "+s1.substring(3,8)); 

System.out.println("\nEquals : "+s2.equals(s3)); 

System.out.println("\nEquals : "+s2.equals(s6)); 

System.out.println("\nUpper case : "+s5.toUpperCase()); 

System.out.println("\nLower case : "+s4.toLowerCase()); 

System.out.println("\nTrim : "+s1.trim()); 
} 
}

need an explanation for this answer? contact us directly to get an explanation for this answer

total answers (1)

Similar questions


need a help?


find thousands of online teachers now