- Trending Categories
Data Structure
Networking
RDBMS
Operating System
Java
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
Physics
Chemistry
Biology
Mathematics
English
Economics
Psychology
Social Studies
Fashion Studies
Legal Studies
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How to determine if an input string ends with a specified suffix in JSP?
The fn:endsWith() function determines if an input string ends with a specified suffix.
Syntax
The fn:endsWith() function has the following syntax −
boolean endsWith(java.lang.String, java.lang.String)
Example
Following example explains the functionality of the fn:substring function −
<%@ 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 = "theString" value = "I am a test String 123"/> <c:if test = "${fn:endsWith(theString, '123')}"> <p>String ends with 123<p> </c:if> <c:if test = "${fn:endsWith(theString, 'TEST')}"> <p>String ends with TEST<p> </c:if> </body> </html>
You will receive the following result −
String ends with 123
- Related Articles
- How to check if a string ends with a specified Suffix string in Golang?
- How to check if an input string contains a specified substring in JSP?
- How to check if string or a substring of string ends with suffix in Python?
- How to check whether an input string contains a specified substring ignoring the case using JSP?
- How to check index within a string of a specified substring in JSP?
- How to check if a string starts with a specified Prefix string in Golang?
- Return a boolean array which is True where the string element in array ends with suffix in Python
- How to check if the string ends with specific substring in Java?
- Create temporary file with specified extension suffix in Java
- Check if a string ends with given word in PHP
- Find if a string starts and ends with another given string in C++
- Python Check if suffix matches with any string in given list?
- Check if string ends with desired character in JavaScript
- Return a boolean array where the string element in array ends with a given suffix but test begin and end in Python
- How to return a new string with a specified number of copies of an existing string with JavaScript?

Advertisements