Check out example codes for "c# enter key press console". It will help you in understanding the concepts better.

Code Example 1

// ---------- How to detect when the input is ENTER? ----------- //

string input = "";

// 1º Method
while(true)
{
  Console.WriteLine("Write something (or hit ENTER to quit): ");
  input = Console.ReadLine();
  
  if( string.IsNullOrWhiteSpace(input)) )
    break;
  else
    // some code...
  
}


// 2º Method
while(true)
{
  Console.WriteLine("Write something (or hit ENTER to quit): ");
  input = Console.ReadLine();
  
  if( input.Equals("") )
    break;
  else
    // some code...
  
}

Learn ReactJs, React Native from akashmittal.com