Template Engine language reference > Template Engine utilities > String functions > $string.equalsIgnoreCase

$string.equalsIgnoreCase
This function compares two strings. Returns true if the strings are equal, if not it returns false. The function is not case sensitive, which means comparing strings like "AbC" and "aBC" will return true.
Syntax
$string.equalsIgnoreCase(<stringA>, <stringB>)
stringA
stringB
Template examples
Example 90
Template
#set($strA='Hello World!')
#set($strB='hello world!')
Equal?: $string.equalsIgnoreCase($strA, $strB)
Original string: $strA
New string: $strB
Output
Equal?: true
Original string: Hello World!
New string: hello world!
 
Example 91
Template
#set($strA='Hello World!')
#set($strB='Hello girls!')
Equal?: $string.equalsIgnoreCase($strA, $strB)
Original string: $strA
New string: $strB
Output
Equal?: false
Original string: Hello World!
New string: Hello girls!
 
Example 92
Template
#set($str='Hello World!')
#set($check=$string.equalsIgnoreCase($str, 'Hello world!'))
#if($check)
$str
#else
No match!
#end
Output
Hello World!
 
Example 93
Template
#set($str='Hello World!')
#set($check=$string.equalsIgnoreCase($str, 'Hello girls!'))
#if($check)
$str
#else
No match!
#end
Output
No match!
 
OpenText StreamServe 5.6.2 Updated: 2018-01-26