KnowledgeHub
Questions
Tags
Users
Search
Alex Rivera
|
Logout
Edit Question
Title
Body
foreach (var name in parent.names) { if name.lastname == null) { Violated = true; this.message = "lastname reqd"; } if (!Violated) { Violated = !(name.firstname == null) ? false : true; if (ruleViolated) this.message = "firstname reqd"; } } Whenever violated is true, I want to get out of the foreach loop immediately. How do I do it?
Tags (comma-separated)
Save Edits
Cancel