C# · Lesson 3 of 4

Check the task name

if chooses which instructions run based on a condition. IsNullOrWhiteSpace checks for an empty name or one containing only spaces.

Your task

Try a task name, then change the value to "" and run again. Compare the messages.

Run with .NET Fiddle

Find the Hello World line inside Main and replace it with your lesson code. Then press Run.

The editor runs code through .NET Fiddle and needs an internet connection. If it does not load or input is unavailable, open it in a new tab ↗.

These checks review your snippet. Run it in the C# editor to confirm the output.

Can you explain the different messages? Try a name containing only spaces, then move on to a task list.

Next: Project: a task list