Top "For-loop" questions

A for loop is a control structure used by many programming languages to iterate over a range.

GoTo Next Iteration in For Loop in java

Is there a token in java that skips the rest of the for loop? Something like VB's Continue in java.

java for-loop
R: Break for loop

Can you confirm if the next break cancels the inner for loop? for (out in 1:n_old){ id_velho <…

r for-loop break
How to get a index value from foreach loop in jstl

I have a value set in the request object like the following, String[] categoriesList=null; categoriesList = engine.getCategoryNamesArray(); request.setAttribute("…

java jsp for-loop foreach jstl
Why is printing "B" dramatically slower than printing "#"?

I generated two matrices of 1000 x 1000: First Matrix: O and #. Second Matrix: O and B. Using the following code, the …

java performance loops for-loop system.out
Java: Best way to iterate through a Collection (here ArrayList)

Today I was happily coding away when I got to a piece of code I already used hundreds of times: …

java collections for-loop
Breaking/exit nested for in vb.net

How do I get out of nested for or loop in vb.net? I tried using exit for but it …

vb.net for-loop nested-loops
Single Line Nested For Loops

Wrote this function in python that transposes a matrix: def transpose(m): height = len(m) width = len(m[0]) return [ [ m[…

python loops for-loop nested nested-loops
Java 8 forEach with index

Is there a way to build a forEach method in Java 8 that iterates with an index? Ideally I'd like something …

java for-loop foreach java-8
Is there a way to access an iteration-counter in Java's for-each loop?

Is there a way in Java's for-each loop for(String s : stringArray) { doSomethingWith(s); } to find out how often the …

java loops for-loop foreach
Excel VBA For Each Worksheet Loop

I am working on code to basically go through each sheet in my Workbook, and then update column widths. Below …

excel vba for-loop each worksheet