I am trying to show a warning to the user by the following code. But it is massing the output text.
Console.ForegroundColor = ConsoleColor.Yellow;
Console.BackgroundColor = ConsoleColor.Red;
Console.WriteLine($"The selected row {selection} is not found in the database.");
Console.ResetColor();
Console.ReadLine();
Environment.Exit(0);
The display looks as follows:-
I only want to make coloring of the text "The selected row is not found in the database.". Nothing extra. Otherwise it looks ugly. How to do it?