Skip to content

Instantly share code, notes, and snippets.

@DominicFinn
Created December 1, 2019 11:51
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save DominicFinn/912b52d6a441d9baf327cc5fecdc2fbd to your computer and use it in GitHub Desktop.
Save DominicFinn/912b52d6a441d9baf327cc5fecdc2fbd to your computer and use it in GitHub Desktop.
Reading a name and seeing what it begins with
using System;
namespace leanne
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Enter name!");
var name = Console.ReadLine();
if (name.StartsWith("L"))
{
Console.WriteLine("Welcome");
}
else
{
Console.WriteLine("Go away!");
}
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment