Michael Pickstone
Michael Pickstone

Reputation: 75

Sorting an array of strings alphabetically in scala

I am trying to sort an Array of Strings in alphabetical order using scala. The Strings are passed in an array when the method is called. The method must also return an array with the sorted Strings. How would I do this?

Thanks

Mike

Upvotes: 2

Views: 8748

Answers (1)

Alexey Romanov
Alexey Romanov

Reputation: 170723

You just need to call array.sorted.

Upvotes: 7

Related Questions