728x90
728x90
SMALL
fn:substring()
- 문자열의 하위 집합을 반환합니다.
Syntax
java.lang.String substring(java.lang.String, int, int)
Example
<%@ taglib uri = "http://java.sun.com/jsp/jstl/core" prefix = "c" %>
<%@ taglib uri = "http://java.sun.com/jsp/jstl/functions" prefix = "fn" %>
<html>
<head>
<title>Using JSTL Functions</title>
</head>
<body>
<c:set var = "string1" value = "This is first String."/>
<c:set var = "string2" value = "${fn:substring(string1, 5, 15)}" />
<p>Final sub string : ${string2}</p>
</body>
</html>
Result
Final sub string : is first S
728x90
728x90
LIST
'JSP > JSTL functions' 카테고리의 다른 글
[JSP][JSTL functions] fn:substringBefore() (0) | 2021.07.30 |
---|---|
[JSP][JSTL functions] fn:substringAfter() (0) | 2021.07.30 |
[JSP][JSTL functions] fn:startsWith() (0) | 2021.07.30 |
[JSP][JSTL functions] fn:split() (0) | 2021.07.30 |
[JSP][JSTL functions] fn:replace() (0) | 2021.07.26 |