Did you know… how to insert a code snippet around a block of code? – #108

C# and XML support the Edit.SurroundWith command that will insert the desired snippet around the selected code (whether it is just a selected word, selected line, or entire function)

Code Snippet Surround With

for loop surrounding a for loop

The keyboard shortcut is Ctrl+K, Ctrl+S.

Technorati tags: VS2005Tip, VS2008Tip

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>