hello guys anyone know how to change this js to c#

please , how to change this into c#

script basicly just turn off object while turning on another same time and vice versa

     #pragma strict
     
var A : GameObject;
var B : GameObject;
     
var On : boolean;
     
function Update () {
    if (Input.GetKeyDown(KeyCode.Return)) {
        if (On == true) {
            On = false;
        } else {
            On = true;
        }
    }
         
    if (On == true) { 
        A.SetActive(true);
        B.SetActive(false);
    } else {
        A.SetActive(false);
        B.SetActive(true);    
    }
}

GameObject A;
GameObject B;
bool On;

void Update(){
  if(Input.GetKeyDown(KeyCode.Return)){
  if (On == true) {
             On = false;
         } else {
             On = true;
         }
 }
if (On == true) { 
         A.SetActive(true);
         B.SetActive(false);
     } else {
         A.SetActive(false);
         B.SetActive(true);    
     }

}