![]() ![]() ![]() | |
![]() | |
![]() | |
![]() |
The +
operator has a special effect when it operates on strings: it concatenates the two string operands. For example, the following statement adds "Congratulations,"
to "Donna!"
:
"Congratulations, " + "Donna!"
The result is "Congratulations, Donna!"
If only one of the +
operator's operands is a string, Flash converts the other operand to a string.
The comparison operators >
, >=
, <
, and <=
also have a special effect when operating on strings. These operators compare two strings to determine which is first in alphabetical order. The comparison operators only compare strings if both operands are strings. If only one of the operands is a string, ActionScript converts both operands to numbers and performs a numeric comparison.
![]() | |
![]() | |
![]() | |
![]() ![]() ![]() |