subject

Run the following code to check how String class Methods work, discuss with tutor, if you need explanation of any method. Make changes and try different variations. String myString ="KOI is my University";
String s1= "KOI";
String s2= "koi";
String s3 = " Hello KOI ";
System. out. println("Char at index 2(third char): " + myString. charAt(2)); System. out. println("After Concat: "+ myString. concat("-Enjoy-")); System. out. println("Checking equals with case: " +s2.equals(s1)); System. out. println("Checking Length: "+ myString. length()); System. out. println("Replace function: "+ myString. replace("fun", "easy")); System. out. println("SubString of myString: "+ myString. substring(8)); System. out. println("SubString of myString: "+ myString. substring(8, 12)); System. out. println("Converting to lower case: "+ myString. toLowerCase()); System. out. println("Converting to upper case: "+ myString. toUpperCase()); System. out. println("Triming string: " + s3.trim()); System. out. println("searching s1 in myString: " + myString. contains(s1)); System. out. println("searching s2 in myString: " + myString. contains(s2));

ansver
Answers: 1

Another question on Computers and Technology

question
Computers and Technology, 22.06.2019 02:30
If you turn on the lock alpha button , what happens
Answers: 1
question
Computers and Technology, 24.06.2019 11:00
Each row in a database is a set of unique information called a(n) ? a.) table. b.) record. c.) object. d.) field.
Answers: 2
question
Computers and Technology, 24.06.2019 18:30
What are the benefits to using presentations to organize and deliver information in the workplace? they add visual appeal. they are easy to update. they ensure accuracy. they can be created quickly. the work can't be lost.
Answers: 1
question
Computers and Technology, 24.06.2019 20:20
Write python code that prompts the user to enter his or her favorite color and assigns the user’s input to a variable named color.
Answers: 1
You know the right answer?
Run the following code to check how String class Methods work, discuss with tutor, if you need expla...
Questions
question
Mathematics, 18.03.2021 07:10
question
Mathematics, 18.03.2021 07:10
question
Mathematics, 18.03.2021 07:10
Questions on the website: 13722367