There are two types of snippets.
1. Insert Snippet
This option in Visual Studio is very useful for inserting quick code snippets at the cursor position.
This functionality helps us in entering a block of code like a foreach structure or class and so on in the code.
Right-click on your code where you want to insert the code snippet and select the “Insert Snippet” option.
Select the snippet you wish to insert. For example select foreach as in the following:
A foreach block will be added and you can now customize it.
Similarly you can add other snippets too.
2. Surround With Snippets
This is used to wrap the selected code into a region
This functionality is used to group your code, to make it cleaner and readable.
Select the code you want to group and right-click and select the Surround With option.
You can select any of the preceding to group your code. For example select #region
#region MyRegion group your code. You can rename the region. Similarly you can use other groups.