web developer👩🏻‍💻

[JSTL] fn:contains 본문

js

[JSTL] fn:contains

natrue 2021. 2. 18. 17:33
728x90

1.  fn:contains  

 : 입력한 문자열에 지정한 문자열이 포함되어있는지 여부를 반환

2.  사용 방법

<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %>
<%@ taglib uri = "http://java.sun.com/jsp/jstl/functions" prefix = "fn" %>
 <c:set var = "str" value = "Hello Natrue"/>
   <c:if test = "${fn:contains(str, 'Natrue')}">
  	 <p> true <p>
   </c:if>
   <c:if test = "${fn:contains(str, 'NaFalse')}">
   	<p>Not false <p>
   </c:if>

 

3. 결과 

true 출력