Does any one know how to how to achieve the "like" effect of SQL in java ? Specifically,how can I compare 2 string like the function like '%anotherString%' in SQL ? The function returns true if the string is like '%another string%' Thanks.
If you just want to do simple wildcard-style matching in a pre-1.4 virtual machine, you can implement a rough matcher without too much code. Here's an example of a function that will match a string against a pattern. Any occurences of the character '*' in the pattern can match 0 or more characters.
Joined: May 13, 2003
Thank you all for your advices. I've got it done !
subject: how to achieve the "like" effect of SQL in java