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
Get step-by-step solutions from verified subject matter experts
