Reputation: 1625
I've got a list of strings called albumList the string has this structure: abc,abc,abc,abc,abc I ask the user to search an album to delete; if the album is found, it will be deleted from the list. There could be more than one album with the same name to be deleted from the list.
private void searchAlbumName(string search)
{
string[] cellVal;
foreach (string x in albumList)
{
cellVal = x.Split(',');
if (cellVal[0].ToString().Equals(search))
{
//do delete here
}
}
}
I'm not sure how to remove every album with the search name
Upvotes: 6
Views: 9538