-- Lingo syntaxstring1startsstring2// JavaScript syntaxstring1.indexOf(string2) == 0;
Operator; compares to determines whether string1 starts with string2 (TRUE or 1) or not (FALSE or 0).
The string comparison is not sensitive to case or diacritical marks; a and Å are considered to be the same.
This is a comparison operator with a precedence level of 1.
This statement reports in the Message window whether the word Macromedia starts with the string "Macro":
-- Lingo syntax
put("Macromedia" starts "Macro")
// JavaScript syntax
var string1 = "Macromedia";
put(string1.indexOf("Macro") == 0);
The result is 1, which is the numerical equivalent of TRUE.