Stringoutputs
Stringoutputs
ASSIGNMENT 1
Date of submission 23 April 2025
Marks 10
Students this is your first assignment and marks will be taken for submission to council also. Write
the question and output in your computer register itself No need for assignment register. No
questions should be missed.
System.out.println("AugmentedReality".replaceAll("Reality", "World"));
String str1 = "Uttar Bharat";
String str2 = "Akhand Bharat";
String result1 = str1.substring(0, 6) + " " + str2.substring(str2.indexOf("B"));
String s1 = "HelloWorld";
String s2 = "JavaProgramming";
String result2 = s1.substring(0, 5) + " " + s2.substring(4);
String s2 = "Programming";
System.out.println(s2.substring(3, 8));
String s1 = "HelloWorld";
String s2 = "JavaProgramming";
String result2 = s1.substring(0, 5) + " " + s2.substring(4);
System.out.println(result2);