Operator Type:
Operator Scope of Action:
Operator Purpose:
Data Type Returned:
Operator First Added:
Operator in Current Baseline:
Operator Last Altered:
Function [other Function type actions]
Item [operators of similar scope]
Data manipulation [other Data manipulation operators]
boolean test
v6.4.0
Baseline
As at baseline
String.endsWith(matchStr)
String.endsWith() returns Boolean true
if the chained string ends with the literal string matchStr. Note that matchStr cannot be a regular expression, only literal string values are allowed.
For example, if $MyString is "I do not like green eggs and ham":
$MyString.endsWith("ham")
returns true
$MyString.endsWith("eggs")
returns false
Also, with string literals:
("There are gentlemen now abed.").endsWith("abed")
returnstrue
("There are gentlemen now abed.").endsWith("night")
returnsfalse
This operator searches for literal strings, not regular expressions. Matches are case sensitive:
("There are gentlemen now abed.").endsWith("Abed")
returnsfalse
See also String.beginsWith(). If you need to search a String for a regular expression, use String.contains().
See also—notes linking to here: