Question: 4. (15 minutes) (20 points) Write a method that takes a string and returns the reversed string obeying the following rule: Spaces must be kept

 4. (15 minutes) (20 points) Write a method that takes a

4. (15 minutes) (20 points) Write a method that takes a string and returns the reversed string obeying the following rule: Spaces must be kept in the same order as the original string. For instance if the input string is "cs 101 java". Your method should return "av aj1 01sc". Hint: Write a method which returns a new string after reversing and removing all the spaces inside the given string. Use this method as an helper

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!