Question: 6 . The Remove Duplicates Method TO DO: 1 . Write a method to remove consecutive duplicate characters from a String. If two or more
The Remove Duplicates Method
TO DO:
Write a method to remove consecutive duplicate characters from a String.
If two or more consecutive duplicate characters have different cases, then the first letter should be kept.
When you run this method, your output should look like this:
Testing the dedupeChars method
dedupeCharsa should be a a
dedupeCharsaa should be a a
dedupeCharsMiSsisSiPpi should be MiSisiPi MiSisiPi
dedupeCharsswimMmMming should be swiming swiming
Step by Step Solution
There are 3 Steps involved in it
1 Expert Approved Answer
Step: 1 Unlock
Question Has Been Solved by an Expert!
Get step-by-step solutions from verified subject matter experts
Step: 2 Unlock
Step: 3 Unlock
