1

I am trying to sort an array by "itemCommodity". I need to sort my array by the smallest number at the start of the string and the highest number at the end. For example:

["Untitled Form - 16", "Untitled Form - 1", "Untitled Form - 7", "Untitled Form - 2", "Untitled Form - 3", "Untitled Form - 4", "Untitled Form - 5", "Untitled Form - 8", "Untitled Form"];

Should be displayed as:

["Untitled Form", "Untitled Form - 1", "Untitled Form - 2", "Untitled Form - 3", "Untitled Form - 4", "Untitled Form - 5", "Untitled Form - 7", "Untitled Form - 8", "Untitled Form - 16"];

I hope someone can help me out with this.

1

0

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.