I have a collection of objects. Each object contains a string called “Status”. I want to check the collection for the last reference of the status being either “Paid” or “NotPaid”.
Any ideas?
Thanks
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Note that “colleciton” by itself does not dictate sequence or ordering, hence there is no concept of last element in a collection.
For a sequenced/ordered version of collection you might have to use List/Queue, in which case getting the last element is very trivial.