I need help to figure out the logic:
So, let's say I have a string, and whenever stringChar repeats inside , I need to replace it with ( Char+ sequence of number).
For example:
Original line: "abcdefgabfabc"
Expected Result: "abcdefga2b2f2a3b3c2"
'a' occurs 3 times, so the first "a" remains as "a", but the second "a" becomes "a2", and the third "a" becomes "a3", and the same applies to other characters like b, b2 , b3 ...
source
share