What is wrong with this C# code I have?

Here is the code, Unity is telling me that an identifier is expected, what ever that means I don't know. Here is the code:

void  SwapArrayItem (nr1, nr2);{
    var tmp=sortedHostList[nr1];
    sortedHostList[nr1]=sortedHostList[nr2];
    sortedHostList[nr2]=tmp;
}

I was in the process of converting JavaScript to C#, how do I make this completely C#?

You need to declare the type for nr1 and nr2. For example:

void  SwapArrayItem (int nr1, int nr2) {
    int tmp=sortedHostList[nr1];
    sortedHostList[nr1]=sortedHostList[nr2];
    sortedHostList[nr2]=tmp;
}

thanks a lot.