Skip to content

Latest commit

 

History

History
15 lines (11 loc) · 881 Bytes

README.md

File metadata and controls

15 lines (11 loc) · 881 Bytes

snippets

Visual Studio Snippets for C# Console apps

This is a collection of snippets I use in C#. To add to Visual Studio: Tools > Code Snippet Manager > Add Folder Add wherever you've saved the snippets to. To use the snippets, type the keyword and use TAB twice.

file keyword output
consolereadline.snippet crr var input = Console.ReadLine();
escapekey.snippet anykey Console.WriteLine("Press any key to exit.");
Console.ReadKey(true);
stringToParse.snippet stip (S)tring (T)o (I)nteger (P)arse_ string stringToParse = "";
int numberOut;
while (!int.TryParse(stringToParse, out numberOut))
{
Console.WriteLine("Please type a number.");
stringToParse = Console.ReadLine();
}

-- @mapgiedev