-
Book Overview & Buying
-
Table Of Contents
-
Feedback & Rating
Tcl/Tk 8.5 Programming Cookbook
The second keyword for string comparison is equal.
The syntax for the string command is as follows:
string equal nocase length int string1 string2
When invoked with the equal keyword the string command will perform a character-by-character comparison of the two strings provided.
The equal keyword accepts two switches, as follows:
-nocase
Strings are compared in a case insensitive manner
-length int
Instructs the interpreter to only perform the comparison on the first length characters
In the following example, we will determine if the values passed as string1 and string2 are equal. Return values from the commands are provided for clarity. Enter the following command:
% string equal Monday monday 0
As you can see, the string equal command has compared the two strings provided and found them to not be a match. When string is invoked with the equal keyword it will perform a character-by-character comparison of the two strings provided...
Change the font size
Change margin width
Change background colour