Tinderbox v9 Icon

String.beginsWith(matchStr)


Operator Type: 

Operator Scope of Action: 

Operator Purpose: 

Operator First Added: 

Operator Last Altered: 

 Function  [other Function type actions]

 Item  [operators of similar scope]

 Data manipulation  [other Data manipulation operators]

 Baseline

 As at baseline


String.beginsWith(matchStr)

String.beginsWith() returns Boolean true if the chained string begins with a specific substring.

For example, if $MyString is "I do not like green eggs and ham":

$MyString.beginsWith("I do") returnstrue 

$MyString.beginsWith("Hello") returnsfalse 

Also, with string literals:

("There are gentlemen now abed.").beginsWith("There are") returnstrue 

("There are gentlemen now abed.").beginsWith("Hello") returnsfalse 

This operator searches for literal strings, not regular expressions. Matches are case sensitive

("There are gentlemen now abed.").beginsWith("there are") returnsfalse 

See also String.endsWith(). If you need to search a String for a regular expression, use String.contains().