I see your point Mikey - although, your code returns the number of duplicates in an array (unless I am mistaken), when what I was trying to acheive was to retreive the number of times string "xyz" was duplicated in an array.
Since my original post, I have modified my code and now it is working...
Thanks guys. From what Dian had suggested I realised that earlier in my code I had defined allResponses as this:
ArrayList<String[]> allResponses = new ArrayList<String[]>();
Once I had changed this to:
ArrayList<String> allResponses = new ArrayList<String>();
I was then effectivley...
Hi there. I have an ArrayList with a bunch of String values in it. I want to be able to check if a particular string appears X amount of times.
To add some context to the dilemma, the strings are date/times (in the format DD/MM/YYYY-HHMM) for which certain attendees are available for a meeting...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.