Do you know that, there exist a snippet to generate reverse 'for' loop?

Do you know that, there exist a snippet to generate reverse 'for' loop?


In every programming language, when you want to loop through a collection, you use the 'for' loop in maximum scenarios. When writing code in Visual Studio, you might be aware that, there exist a code snippet to write the for-loop structure.

 

But you might not noticed that, there exist another code snippet to generate a reverse for-loop. Let's see what it is and how it operates.

 

Do you know that, there exist a snippet to generate reverse 'for' loop?

 

Code snippets are the templates that makes it easier to generate repeating code patterns, such as loops, conditional statements or try-catch exception block. The code snippet 'for' does the same to generate a normal for-loop.

 

To generate the for-loop structure, write 'for' inside your Visual Studio code editor and press TAB key twice to generate it:

Generate for-loop using the 'for' code snippet

Did you check the book titled 'Mastering Visual Studio 2017'? It covers all the new features introduced in Visual Studio 2017. You can buy the book from Amazon at: http://amzn.to/2uFTRy8.

 

The other code snippet 'forr' is there to create a reverse for-loop structure. In your Visual Studio code editor window, type 'forr' and press TAB key twice. This will result the following code block in the editor:

Generate reverse for-loop using the 'forr' code snippet

 

I hope that the post was clear and easy to understand. For more posts on Visual Studio Tips & Tricks, stay tuned to this blog.

 

 



If you have come this far, it means that you liked what you are reading. Why not reach little more and connect with me directly on Twitter, Facebook, Google+ and LinkedIn. I would love to hear your thoughts and opinions on my articles directly. Also, don't forget to share your views and/or feedback in the comment section below.

1 comments

  1. I read some articles on this site and I think your blog is really interesting and has great information. Thank you for your sharing.

    ReplyDelete

 
© 2008-2017 Kunal-Chowdhury.com - Microsoft Technology Blog for developers and consumers | Designed by Kunal Chowdhury
Back to top