Answered step by step
Verified Expert Solution
Link Copied!

Question

1 Approved Answer

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

image text in transcribed

image text in transcribed

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

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_2

Step: 3

blur-text-image_3

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

Oracle 11G SQL

Authors: Joan Casteel

2nd Edition

1133947360, 978-1133947363

More Books

Students also viewed these Databases questions

Question

How many jobs underperformed on profit margin?

Answered: 1 week ago

Question

How many jobs underperformed on budgeted profit?

Answered: 1 week ago