Wie springe ich in C#aus einer Foreach -Schleife?C#

Ein Treffpunkt für C#-Programmierer
Anonymous
 Wie springe ich in C#aus einer Foreach -Schleife?

Post by Anonymous »

Wie bringe ich aus einer Foreach -Schleife in C# aus, wenn eines der Elemente der Anforderung erfüllt? < /p>

Zum Beispiel: < /p>

Code: Select all

foreach(string s in sList){
if(s.equals("ok")){
//jump foreach loop and return true
}
//no item equals to "ok" then return false
}

Quick Reply

Change Text Case: 
   
  • Similar Topics
    Replies
    Views
    Last post