C# equivalent to Java's continue

前端 未结 5 1758
南笙
南笙 2020-12-14 06:13

Should be simple and quick: I want a C# equivalent to the following Java code:

orig: for(String a : foo) {
  for (String b : bar) {
    if (b.equals(\"buzz\"         


        
5条回答
  •  情深已故
    2020-12-14 07:10

    In VB.Net, you could just have one while loop and one for loop and then exit the desired scope level.

    In C#, maybe break; ?

    That might break out of the inner loop and allow the outer loop to keep going.

提交回复
热议问题