Question: to be familiar with regular expressions, do not use them for this problem. That would be too easy ) Examples of valid SSNs: 123-45-6789 123

 to be familiar with regular expressions, do not use them for

this problem. That would be too easy ) Examples of valid SSNs:

to be familiar with regular expressions, do not use them for this problem. That would be too easy ) Examples of valid SSNs: 123-45-6789 123 45 6789 123456789 Examples of invalid SSNs: 123-45 6789 12345 6789 1SS-N4-SALE (6 pts) Your website from the previous problem stores most of its user registration information as strings in a database, and you want to ensure that it's consistently formatted. Specifically, you want to eliminate any leading and trailing spaces, and eliminate any extra spaces within the body of each string. Note that you're not removing ALL spaces from the string - only the extraneous ones! 2. Write a method trim(String s) that returns a version of the parameter s with all extra spaces removed as described above. Calling trim with a string of all spaces as the argument should return the empty string (i.e., the string containing no characters). Note: do not use the built-in trim method of the String class in your solution

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!