34,333
edits
Changes
→Using switch Statements to Iterate Through Ranges and Collections
</pre>
Similarly, the elements of an array can be passed through to the switch statement. The In the following example, the array output from a directory listing is run through the switch statement to identify text and Word documents by checking the file name extension of each file name:
<pre>