TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Sudheer Kumar
NA
105
10.4k
how to edit or modify a list collection which is iterating
Jan 6 2017 2:23 AM
i am having two list collections one for new persons and one for existing persons and my condition is if the record in new person matches with existing person it should remove the record from existing person for that i am using the following code
foreach(var p in existingperson)
{
if(newperson.id==p.id)
{
existingperson.remove(p);
return true;
}
else
{
return false;
}
}
its throwing an exception that i cant change collection in iteration.for using for loop i dont know the count of existing records..please help
Reply
Answers (
2
)
Arrays & IF Statement
Generate array for RGB range