fn:toLowerCase()函数

JSTL fn:toLowerCase() 函数与 fn:toUpperCase() 函数作用相反,用来将指定字符串中的所有字符转为小写。

语法

JSP fn:toLowerCase() 函数的语法如下。
String fn:toLowerCase(String sourceStr)
其中,sourceStr 为指定的字符串。

示例

下面为 fn:toLowerCase() 函数的简单实例。
<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<!DOCTYPE html>
<html>
<head>
<title>编程帮(www.biancheng.net)</title>
</head>
<body>
    <c:set var="msg" value="WELCOME TO BIANCHENGBANG" />
    ${fn:toLowerCase(msg)}
</body>
</html>

页面输出内容如下:

welcome to bianchengbang