I have an String arraylist with the following content:
[0] = "ID: 12"
[1] = "Term: Banana"
[2] = "Definition = yellow fruit"
[3] = "ID: 14"
[4] = "Term: Apple"
[5] = "Definition = green fruit"
[6] = "Description = Beautiful fruit"
[7] = "ID: 16"
[8] = "Term: Melon"
[9] = "Definition = yellow fruit"
I only need the output from ID to the next ID.
For example:
Term: Apple
Definition = green fruit
Description = Beautiful fruit
How can I access it without specifying the exact location. I thought of contains("ID")
until the next contains("ID")
, I just don't know how to implement it.
Thank you very much for your help