Question: JAVA Question: Question 1: Is there a way to replace comma,space,semi colon,etc to in one line code using replaceAll()? For example : A=hell:;! o;

JAVA Question:

Question 1: Is there a way to replace comma,space,semi colon,etc to "" in one line code using replaceAll()?

For example : A=hell:;! o;

B=A.replaceAll(";",""); // This just removes semi colon. Is there a way to remove every commas, punctuation,spaces in a single line code?

Question 2: to check a string is PALINDROME or not, how to use Exception Handling Mechanism so that it ignores all the spaces, punctuations, commas, etc. Like using TRY/CATCH

Thank you

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!