ContainsIgnoreCase in JSP -
hi want search word in given string in jsp , using string.contains(). case sensitive , want ignore case. have tried string.containsignorecase("") showing error. there other way? searched , found code use
<c:set var="thestring" value="i test string"/><c:if test="${fn:containsignorecase(thestring, 'test')}"> <p>found test string<p> but not working. can other ways?
btw talking jstl functions tag. has containsignorecase function. expecting jsp has jstl tag references:
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %> <%@taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %> ..... <c:set var="thestring" value="i test string"/> <c:if test="${fn:containsignorecase(thestring, 'test')}"><p>found test string</p></c:if> you need close p , c:if tags.
Comments
Post a Comment