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