Question
(java) Write a program that uses String method regionMatches to compare two strings input by the user. The program should prompt the user to enter
(java) Write a program that uses String method regionMatches to compare two strings input by the user. The program should prompt the user to enter two strings, the starting index in the first string, the starting index in the second string, and the number of characters to be compared. The program should print whether or not the strings are equal. (Ignore the case of the characters during comparison)
Run like:
Enter first string:Have yourself a mery little Christmas.
Enter second string:It's beginning to look a lot like christmas.
Enter starting index for first string:29
Enter starting index for second string:34
Enter number of characters to be compared:9
true
Step by Step Solution
There are 3 Steps involved in it
Step: 1
Get Instant Access to Expert-Tailored Solutions
See step-by-step solutions with expert insights and AI powered tools for academic success
Step: 2
Step: 3
Ace Your Homework with AI
Get the answers you need in no time with our AI-driven, step-by-step assistance
Get Started