Thus the question is imho wrong. It's not about efficiency. The question is:
What is the correct logic?
Skale
ASKER
Yes for removing two last items first i remove last and then read that one and again remove last one so at the end i can be able to remove last two one. Yes you're right it's more about logic.
parseFullName = parseFullName.Where(w => w != parseFullName[Array.IndexOf(parseFullName, parseFullName.Last())]).ToArray();
parseFullName = parseFullName.Where(w => w != parseFullName[Array.IndexOf(parseFullName, parseFullName.Last())]).ToArray();
ste5an
Please confirm that you want the following output for the given samples:
The code splits a string and then removes all occurences of the first and last two items. E.g.
Open in new window
returns d_e. But as First and Last are defined on the mutating intermediate result, this means especially Last is not a fixed value. E.g. usingOpen in new window
returns also d_e.Thus the question is imho wrong. It's not about efficiency. The question is:
What is the correct logic?