In my Android app I have a String[]
initialized like this:
String[] array = {"abc", "def", "abc", "ghi", "def", "def"};
How can I check how many times every String appears in the String[]
? For example, "abc"
appears 2 times, "def"
appears 3 times, and "ghi"
appears only once.
I'll appriciate it if you'll help me to figure it out. Thanks!