I'm trying to compare a string to an ArrayList Object. But no matter how I try to compare it, such as just ==, or .equals(), or .compareTo(), or String.valueOf(ArrayList.get()) with all of the above options, it won't compare correctly, even if they are equal when outputted they aren't equal when compared. I can post the whole code if you want me to, it is to have a word <= 5 characters input and rearranged every way possible but not outputting duplicates. I can get the every possible output part but I can't seem to compare the string to an ArrayList object. Thanks in advance for your help.
shdwdrgn517
0
Newbie Poster
Recommended Answers
Jump to Post>I'm trying to compare a string to an ArrayList Object.
This is your problem. Unless you can figure out a way to convert the ArrayList to a String so that they are comparable, you'll need to manually compare each item individually in a loop.
All 4 Replies
shdwdrgn517
0
Newbie Poster
Narue
5,707
Bad Cop
Team Colleague
shdwdrgn517
0
Newbie Poster
shdwdrgn517
0
Newbie Poster
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.