I trying to find out if one string contains another. But, unfortunately, fn:contains function is case-sensitive. Are there are any ways to make it case-insensitive?
I tried to put both into one case:
fn:contains(car.color.toLowerCase(), smartBean.txt.toLowerCase()) ? 'true' : 'false'
But it didn’t work due to method’s brackets. I also can’t use f:to-upper inside f:contains function.
There’s a
fn:containsIgnoreCase(). Just use it instead.By the way, your failed
toLowerCase()attempt should have been done as follows:Using
toUpperCase()works as good as well:Perhaps you just made an EL syntax error.
Note that the
? 'true' : 'false'part is completely superfluous as that’s already returned by the function.