You need to sign in to do that
Don't have an account?
Position of characters after sorting from list
Hi,
I have list of characters(Unsorted & duplicate). I want know actual index value after sorting.
e.g.
List<string> str =new List<string>{'c','m','a','x','a','n','c','p','z'}
after sorting it will be
List<String> str =new List<string>{'a','a','c','c','m','n','p','x','z'}
I want to know position of characters after sorting.
Thanks in advance
Kanhaiya
I have list of characters(Unsorted & duplicate). I want know actual index value after sorting.
e.g.
List<string> str =new List<string>{'c','m','a','x','a','n','c','p','z'}
after sorting it will be
List<String> str =new List<string>{'a','a','c','c','m','n','p','x','z'}
I want to know position of characters after sorting.
Thanks in advance
Kanhaiya
To know index of values in a list, you can use indexOf(listElement) method.
It returns the index of the first occurrence of the specified element in this list. If this list does not contain the element, returns -1.
public Integer indexOf(Object listElement);
Hope it will help you.