0

I had used array.sort function to sorting an array, but this function not return new array but affected older.

To keep an original array, I create new array manualy, but sort function just affected both new array and original

Dim newardata = ardata
array.sort(newardata)

What should i do to keep that original array, thanks

2

1 Answer 1

1

You aren't creating a new array in your code. Try cloning the array.

Dim newardata = ardata.Clone()
array.sort(newardata)

You could also try OrderBy.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.