12,893,086 members (60,693 online)
Alternative Tip/Trick
alternative version

#### Stats

3.3K views
Posted 30 Aug 2011

# Super-Easy Code Block Toggling

, 30 Aug 2011 CPOL
 Rate this:
This nice trick extends into://*/block 1/*/block 2; // commented out/*/block 3;/*/block 4; // commented out//*/and removing the first slash gives inverted alternation:/*/block 1; // commented out/*/block 2;/*/block 3; // commented out/*/block...
This nice trick extends into:

```<pre lang="c#">//*/<br />
block 1<br />
/*/<br />
block 2; // commented out<br />
/*/<br />
block 3;<br />
/*/<br />
block 4; // commented out<br />
//*/</pre>```

and removing the first slash gives inverted alternation:

```<pre lang="c#">/*/<br />
block 1; // commented out<br />
/*/<br />
block 2;<br />
/*/<br />
block 3; // commented out<br />
/*/<br />
block 4;<br />
//*/</pre>```

This enables you to alternate between odd and even sequential blocks :). It will extend to infinite count of blocks! Even more curious but sometimes usefull nonetheless, alternation can be switched wherever you like:

```<pre lang="c#">/*/<br />
block 1; // commented out<br />
/*/<br />
block 2;<br />
/*/<br />
block 3; // commented out<br />
/*/<br />
block 4;<br />
/*/<br />
block 5; // commented out<br />
/*/<br />
block 6;<br />
//*/</pre>```

can be switched into:

```<pre lang="c#">/*/<br />
block 1; // commented out<br />
/*/<br />
block 2;<br />
/*/<br />
block 3; // commented out<br />
/*/<br />
block 4;<br />
//*/<br />
block 5;<br />
/*/<br />
block 6; // commented out<br />
//*/</pre>```

:D ILa

## Share

 Engineer Netherlands
No Biography provided

## You may also be interested in...

 First Prev Next
 Reason for my vote of 5 Superb my 5 Ashish Tyagi 406-Sep-11 19:12 Ashish Tyagi 40 6-Sep-11 19:12
 Last Visit: 31-Dec-99 18:00     Last Update: 27-Apr-17 20:03 Refresh 1