• Post Reply Bookmark Topic Watch Topic
  • New Topic

String Search  RSS feed

 
manushree deepak
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I have a List of string combinations like "1,2" "1" "2" i want to compare these List of Strings with strings "1,2" "1" "2" "2,1".I used String contains it gives me true if i compare "1,2" with "1,2" and false for "2,1".In my case it should return true for "2,1".Please help me in resolving this problem.

thank you.
 
Greg Charles
Sheriff
Posts: 3015
12
Firefox Browser IntelliJ IDE Java Mac Ruby
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Although your exact requirements aren't clear from your one example, I can guess that your solution will probably involve the split(String regex) method in Java's String class, and will probably also involve sorting.
 
Jeff Verdegan
Bartender
Posts: 6109
6
Android IntelliJ IDE Java
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You'll have to describe your requirements much more precisely than that. It's not clear at all how you want this code to behave.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!