User`s manual

5-3
String Comparisons
Strings may be compared for equality or alphabetic precedence. When they
are checked for equality, every character, including any leading or trailing
blanks, must be the same or the test fails.
600 IF Z$="END"THEN999
Strings are compared character-for-character from left to right. Actually, the
ASCII codes for the characters are compared, and the character with the
lower code number is considered to precede the other character. (See
Appendix C, ASCII Codes.)
For example, the constant "A!" precedes the constant "A#", because "!" (ASCII
code: decimal 33) precedes "#" (ASCII code: decimal 35). When strings of
differing lengths are compared, the
shorter string is precedent
if its
characters are the same as those in the longer string. For example, "A"
precedes "A ".
The following relational symbols may be used to compare strings;
Note:
Whenever a string constant is used in a comparison expression or an
assignment statement, the constant must be enclosed in quotes:
A$="CONSTANT"
IF A$="CONSTANT" PRINT A$
(The quotes are required in both cases.)