kota's memex

System.Text.StringBuilder can be used to build up a string iteratively without creating lots of allocations:

System.Text.StringBuilder text = new System.Text.StringBuilder();
while (true)
{
  string? input = Console.ReadLine();
  if (input == null || input == "") break;
  text.Append(input);
  text.Append(' ');
}
Console.WriteLine(text.ToString());