I need to return unique value of character in string.
I'm using String.indexOf()
, but it doesn't work correct for me.
For example: camera
indexes: c-0, a-1, m-2, e-3, r-4, a-5
String.indexOf()
always returns index 1 for letter "a", not 1 and 5 as I need.
Any ideas how to solve it?