I need a comparator in java which has the same semantics as the sql \'like\' operator. For example:
myComparator.like(\"digital\",\"%ital%\");
myComparator.l
You could turn '%string%' to contains(), 'string%' to startsWith() and '%string"' to endsWith().
You should also run toLowerCase() on both the string and pattern as LIKE is case-insenstive.
Not sure how you'd handle '%string%other%' except with a Regular Expression though.
If you're using Regular Expressions: