I've been stumped by this for a while now. I have an array of strings all of which contain some numeric value that I need to extract and use for comparison in order to sort the array. I have tried making use of the built in method sort with a comparator but have not been successful with it.
If anyone could give me a little insight or point me in the right direction that would be greatly appreciated.
The array contains strings in the format: "NAME has worked x hours"
My intent is to pull the number out and sort based off the value of the integer while still keeping the relationship to the name.
public static <T> void sort(T[] a, Comparator<? super T> c)