728x90
728x90
SMALL
fn:contains()
- 입력 문자열에 지정된 하위 문자열이 포함되어 있는지 테스트합니다.
Syntax
boolean contains(java.lang.String, java.lang.String)
Example
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %>
<html>
<head>
<title>JSTL functions contains</title>
</head>
<body>
<c:set var="str" value="Hello World."/>
<c:if test="${fn:contains(str, 'hello')}">
<p>Found 'hello' string<p>
</c:if>
<c:if test="${fn:contains(str, 'Hello')}">
<p>Found 'Hello' string<p>
</c:if>
</body>
</html>
Result
Found 'Hello' String.
728x90
728x90
LIST
'JSP > JSTL functions' 카테고리의 다른 글
[JSP][JSTL functions] fn:join() (0) | 2021.07.26 |
---|---|
[JSP][JSTL functions] fn:indexOf() (0) | 2021.07.26 |
[JSP][JSTL functions] fn:escapeXml() (0) | 2021.07.26 |
[JSP][JSTL functions] fn:endsWith() (0) | 2021.07.25 |
[JSP][JSTL functions] fn:containsIgnoreCase() (0) | 2021.07.25 |