Tech
Forums
Jobs
Books
Events
Videos
Conference
Annual Conference
Bcrypt
Ai Conference
Live
More
Interviews
Certification
Training
Career
Members
News
Blogs
Contribute
An Article
A Blog
A Video
An Ebook
An Interview Question
Register
Login
3
Answers
Foreach loop - Skip an item and go to next one
Ask a question
Ask a question
Upload Source Code:
Select only zip and rar file.
Sam
10y
1.2k
1
Reply
Hi,
I have a foreach loop that iterates through a list of files by their name, and then, in another class, still within the loop, opens each file and manipulates it in various ways.
When encountering a bad file (which I can easily detect), I wish to skip the file data manipulation, ignore that file and go to the next item (file name) in the foreach loop.
In short: How can one skip an item in foreach loop and continue with the next one?
Thanks
samatl
Post
Reset
Cancel
Answers (
3
)
Next Recommended Forum
Sealed Class
Regular Expression please..