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

$string.startsWith
This function tests if a string starts with the specified prefix. Returns true if the input string starts with the specified prefix, if not it returns false.
Syntax
$string.startsWith(<inStr>, <prefix>)
inStr
prefix
Template examples
Example 94
Template
#set($str='LABEL_CustNo')
#set($check=$string.startsWith($str, 'LABEL'))
#if($check)
$str
#else
No match!
#end
Output
LABEL_CustNo
 
Example 95
Template
#set($str='LABEL_CustNo')
#set($check=$string.startsWith($str, 'VALUE'))
#if($check)
$str
#else
No match!
#end
Output
No match!
 
OpenText StreamServe 5.6.2 Updated: 2018-01-26