I have 2 arrays. I want to sort them by same index number. For example I have these:
int[] a = {120, 60, 50, 40, 30, 20};
int[] b = {12, 29, 37, 85, 63, 11};
Array.Sort(b); // Now, b is -> b = {11, 12, 29, 37, 63, 85}
I want to sort a by b's index -> a = {20, 120, 60, 50, 30, 40}
If I have also string array c -> c = {"b", "u", "r", "s", "a", "1"}
I want to sort c by b's index -> c = {"1", "b", "u", "r", "a", "s"}
How can I do this?
Thanks in advance,
Regards.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…