Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

with java language Summary Practice use of various methods of the String class. Program Description Write a program that does the following: 1. Create a

with java language image text in transcribed
Summary Practice use of various methods of the String class. Program Description Write a program that does the following: 1. Create a string si and initialize it to "CPCS202: Programming 1" 2. Create a string s2 and initialize it to "CPCS203: Programming 2 3. Create a string s3 and initialize it to "CPIT305: Advanced Programming 4. Create a string reference that also points to the same string si 5. Call compareTo () and compare to Ignorecase () on si to s2 and also s2 to si. 6. Compare references of si to all other strings. 7. Demonstrate the use of the regionMatches () method on all strings. 8. Demonstrate the use of the startsWith() and endsWith() methods on all strings. java.lung String Holowerck Sering Retums a new string with all characters converted to lowercase -UpperCase String Returns a new string with all characters converted to uppercase trime: String Retums a new string with blank characters trimmed on both sides replacefoldCharchar, Retums a new string that replaces all matching character in this new Charcha: String string with the new churacter replaceFirst oldString: Strine. Retums a new string that replaces the first matching substring in newString: String): String this string with the new substring. replace All oldString: String Retums a new string that replace all matching substrings in this new String: String: String string with the new substring, splitdelimiter String Retums an array of strings consisting of the substrings split by the String delimiter java.lang String indexOlich chart Return the index of the first occurrence of ch in the string Returns not matched indexOfichchar , fromIndex Returns the index of the first occurrence of challer fronden in mint the string Returns lifat matched indexo Stringit Returns the index of the fint occurrence of strings in this string Returns if not matched indexOfString, from Index Rerum the index of the first occurrence of strings in this string int in after fronden. Returns if not matched LastIndexOfich in int Returns the index of the last accumence of ch in the string Returns if not matched lexonchi Returns the index of the last occurence of ch before fromlndex frumnade intint in this string, Retums- if not matched Latex Stringit Returns the index of the last occurence of string Retums ir not matched Landerol String Returns the index of the last occurrence of strings before from Indent: frominde. Hetums if not matched

Step by Step Solution

There are 3 Steps involved in it

Step: 1

blur-text-image

Get Instant Access to Expert-Tailored Solutions

See step-by-step solutions with expert insights and AI powered tools for academic success

Step: 2

blur-text-image

Step: 3

blur-text-image

Ace Your Homework with AI

Get the answers you need in no time with our AI-driven, step-by-step assistance

Get Started

Recommended Textbook for

XML Data Management Native XML And XML Enabled Database Systems

Authors: Akmal Chaudhri, Awais Rashid, Roberto Zicari, John Fuller

1st Edition

0201844524, 978-0201844528

Students also viewed these Databases questions