C# C# Basics (Retired) Console I/O Console I/O

Getting an error in Console I/0

So trying to figure out how to debug this line of code.

CODE: string bookTitle = System.Console.Readline(bookTitle);

something to do with System.Console.Readline()

System.Console.Write("Enter a book title: ");
string bookTitle = System.Console.Readline(bookTitle);

Sorry, new to Treehouse!

1 Answer

Jennifer Nordell
Jennifer Nordell
Treehouse Teacher

Hi there, Michael Craig ! I received your request for assistance. You're definitely on the right track. The error you're receiving is that there is no definition for the Readline method. And it's correct. There is however, a definition for the ReadLine method. Note the capitalization on the "L". Assume going forward that literally everything in programming will be case-sensitive. When you fix that, you will still have an error because the ReadLine() method takes no arguments. This means that the parentheses should be empty.

You wrote:

string bookTitle = System.Console.Readline(bookTitle);

But that should be:

string bookTitle = System.Console.ReadLine();

Hope this helps! :sparkles:

Thank you so much! This helped a lot and I was getting stressed. Thanks again and have a good day/afternoon/evening!