Let's say I have an array like this:
String[] = {
    "#abc #def",
    "#abc",
    "#def",
    "#xyz #def"
}
My question is I want to search for specific character or string like "#abc" or "a" and get their positions in the array.
Just loop through it and check each string yourself
for(int i=0; i < array.length; i++)
    if(array[i].contains("#abc"))
        aPosition = i;
If you want to store multiple positions, you'll need a mutable array of some sort such as a List, so instead of aPosition = i you'll have list.add(i)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With