Name

fn:contains

Synopsis

This function tests if a string contains a substring and returns true if it does, otherwise false.

Syntax

boolean: fn:contains(string, substring)

Parameters

Parameter name

Java type

Description

string
String

The string to test.

substring
String

The substring to look for.

Example

<c:if test="${fn:contains(header['User-Agent'], 'MSIE')}">
  Your browser claims to be Internet Explorer
</c:if>

Get JavaServer Pages, 3rd Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.