I have a list and want to remove the first item while keeping the index of the next the same. For example:
public List<string> Fruit
{
get
{
List<string> fruits = dataSource.GetFruits();
return messageStatuses ;
}
}
result returned
[0] -- apple
[1] -- grape
[2] -- orange
[3] -- peach
when the first item is remove the result should be:
[1] -- grape
[2] -- orange
[3] -- peach
You can use dictionary for this
Now
dic[1]will give you"Grape"