Question: java for begginers, please help me Objectives: After the completion of this lab, students should be able to: Declare and create Strings. Apply some operations
Objectives: After the completion of this lab, students should be able to: Declare and create Strings. Apply some operations on Java Strings Lab Exercises: Lab Exercise 1 - String Operations haddah Home Problem Description: Write a Java program (StringOperations 1.java) that performs some operations on the following string literal: "Welcome! This is "CS110" Course". Create an object of class String called str that hold the above string literal, Print out the string str, Convert all alphabets to upper-case letters and print out the result, Convert all alphabets to lower-case letters and print out the result. Print out the length of the string, Print out the index of the word Course, Remove the three occurrences of the char'c' or 'C' and print out the result, Search for CS110 and replace it with CE211. Sample output: The original string: Welcome! This is "CS110" Course Upper Case: WELCOME! THIS IS "CS110" COURSE Lower Case: welcome! this is "es 110" course Length: 31 Index of 'Course': 25 Removing the first 3 [c or C]chars: Welome! This is "S110" ourse Replacing 'CS110' with 'CE211: Welcome! This is "CE211" Course
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
