Question: in java, complete the sperateDuplicateChars() method. - The method takes a String str as a parameter and returns a new String. - The returned String

in java, complete the sperateDuplicateChars() method. - The method takes a String str as a parameter and returns a new String. - The returned String should be exactly like str, but any identical characters that appear in a consecutive way must be separated by hyphens -. - You may ONLY use the following methods from the String class: charAt(), substring() and length().

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!