Question: Java code. Looking for a simple solution to learn from. I'm looking for method that uses Stack to convert the passed string (case insensitive) to

Java code. Looking for a simple solution to learn from.

I'm looking for method that uses Stack to convert the passed string (case insensitive) to uppercase form. For example:

"Wooorrrrrllld" without quotes, it should return "WO3R5L3D".

"Maaaaaanny" without qutes, it should return "MA6N2Y"

If it's only one character, do not return the number 1 next to it.

For a starting method please use "public static String myFunction(String myString)".

myString is a String that is passed in.

The return should return the string with the number of occurences as the examples above.

However, if the string passed in is null or empty, it should return null.

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!