Exploring console applications further
We have already created and used basic console applications, but we're now at a stage where we should delve into them more deeply.
Console applications are text-based and are run at the command line. They typically perform simple tasks that need to be scripted, such as compiling a file or encrypting a section of a configuration file.
Equally they can also have arguments passed to them to control their behavior. An example of this would be to create a new console app using the F# language with a specified name instead of using the name of the current folder, as shown in the following command line:
dotnet new console -lang "F#" -name "ExploringConsole"
Displaying output to the user
The two most common tasks that a console application performs are writing and reading data. We have already been using the WriteLine
method to output, but if we didn't want a carriage return at the end of the lines, we could...