Couple of days back we have discussed about one of the hidden and very useful code snippet, ‘propfull – for property and backing field’. Today you will learn another interesting code snippet ‘forr’
. Yes, you read it correctly ! ‘forr’
. You must be familiar with ‘for’
code snippet that generates basic for-loop structure. Where as, ‘forr’
generates the reverse for-loop .
For an instance if you type “for
” and then press TAB
key twice, a default for-loop will be generated as shown in below. The default loop will have an ‘index’ – i
and a max length variable defined as ‘length’
Now, in the case of ‘reverse for-loop’, you can use ‘forr’
. That will generate a reverse for-loop as shown below, where you will find a similar index and length variable as general for-loop but in decreasing manner.
Hope you will use it going forward.