Sorting an array - C#

Hi, I’m trying to make a ranking with the best scores. All scores are stored in an array, but when I try to sort the values to make a ranking, Unity returns the following message:

Assets/Scripts/Test.cs(12,29): error CS1501: No overload for method Sort' takes 0’ arguments
and
Assets/Scripts/Test.cs(12,27): error CS0103: The name `Array’ does not exist in the current context

I looked for answers in Unity Answers, Unify Community, MSDN Library, but still doesn’t work. Is possible sort values in Unity/C#?

My Code:

public int[] playerScore = new int [] {35, 53, 32, 27, 16, 72, 44, 83, 51, 91};

// Use this for initialization
void Start () {
	
	playerScore.Sort();
	
}

and another try:

public int[] playerScore = new int [] {35, 53, 32, 27, 16, 72, 44, 83, 51, 91};
public int[] ranking;

// Use this for initialization
void Start () {
	
	ranking = Array.Sort ( playerScore );
	
}

Thanks guys!!

This works just fine.

using System;

namespace TestProject
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] one = { 5, 78, 68, 987, 5, 3, 6, 4 };
            Array.Sort(one);

            for (int i = 0; i < one.Length; i++)
            {
                Console.WriteLine(one*);*

}
Console.ReadLine();
}
}
}
Array.Sort is a static function and returns void. So both tries were almost right, but not completely. Check it here: Array.Sort Method (System) | Microsoft Learn

Well, what imports do you have? You need to get System.Linq in order to use IEnumerable.Sort()

Edit:
After some research, try using IEnumerable.OrderBy instead.

playerScore.OrderBy(score=>score);

hey just use System namespace it works