# Sorting an Array

**URL:** <https://forum.kirupa.com/t/sorting-an-array/223948>\
**Category:** Uncategorized\
**Created:** [April 27, 2007, 12:56am UTC](https://forum.kirupa.com/t/sorting-an-array/223948 "2007-04-27T00:56:42Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![matthewjumps](https://avatars.discourse-cdn.com/v4/letter/m/49beb7/32.png) [@matthewjumps](https://forum.kirupa.com/u/matthewjumps)\
**Post date:** [April 27, 2007, 12:56am UTC](https://forum.kirupa.com/t/sorting-an-array/223948/1 "2007-04-27T00:56:42Z")

</div>

Is there a way to do a sort on one array, and then use the new order created as a result of the sort to sort a corresponding array/s?

say i have

```auto

array1:Array = new Array("c", "e", "a", "d", "b");

array2:Array = new Array("sfas", "weradfa", "asdf", "etw", "nvbncv");

```

if i sort array1, how can i make array2 match the new order of array1?
