616
Chapter 13: Operators
starts
Usage
-- Lingo syntax
string1
starts
string2
// JavaScript syntax
string1
.indexOf(
string2
) == 0
;
Description
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.
Example
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
.
See also
contains
Summary of Contents for DIRECTOR MX 2004
Page 1: ...DIRECTOR MX 2004 Director Scripting Reference...
Page 48: ...48 Chapter 2 Director Scripting Essentials...
Page 100: ...100 Chapter 4 Debugging Scripts in Director...
Page 118: ...118 Chapter 5 Director Core Objects...
Page 594: ...594 Chapter 12 Methods...
Page 684: ...684 Chapter 14 Properties See also DVD...
Page 702: ...702 Chapter 14 Properties See also face vertices vertices flat...
Page 856: ...856 Chapter 14 Properties JavaScript syntax sprite 15 member member 3 4...
Page 1102: ...1102 Chapter 14 Properties...