See if element in array exsists

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • chanshaw
    New Member
    • Nov 2008
    • 67

    See if element in array exsists

    Alright I can't seem to think about this correctly, I want to see if any of the elements in the first array have the same matching value in the second array and if it does print the value that matches

    Code:
        public void compareArrays()
        {
            for(int i = 0; i < convertedBlockedApps.length;i++)
            {
                for(int x = 0; x < convertedParsedString.length; x++)
                {
                    
                }
            }
        }
  • JosAH
    Recognized Expert MVP
    • Mar 2007
    • 11453

    #2
    Convert your arrays to Lists (read the API documentation) and use the removeAll(List otherList) method on one of your Lists. Convert the result back to an array again. Also read the API documentation for the Arrays utility class.

    kind regards,

    Jos

    Comment

    Working...