728x90
728x90
SMALL
fn:endsWith()
- 입력 문자열이 지정된 접미사로 끝나는지 테스트합니다.
Syntax
boolean endsWith(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 endsWith</title>
</head>
<body>
<c:set var="str" value="Hello World."/>
<c:if test="${fn:endsWith(str, 'World')}">
<p>String ends with 'World'<p>
</c:if>
<c:if test="${fn:endsWith(str, 'World.')}">
<p>String ends with 'World.'<p>
</c:if>
</body>
</html>
Result
String ends with 'World.'
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:containsIgnoreCase() (0) | 2021.07.25 |
[JSP][JSTL functions] fn:contains() (0) | 2021.07.25 |