See also: compareNoCase |
Determines whether or not two strings are equal.
JSV_compare(expS1, expS2)
expS1.compare(expS2)
The compare function returns true if expS1 and expS2 are equal.
The compare function uses the following arguments.
Argument | Description |
expS1 | One of the strings that is to be evaluated for equality. |
expS2 | The other string that is to be evaluated for equality. |
n/a
n/a
The following lines of code
var testString1 = "bob", testString2 = "Bob";
document.write("Is " + testString1 + " is equal to " + testString2 + "? " +
testString1.compare(testString2) );
var testString1 = "BOB", testString2 = "Bob";
document.write("Is " + testString1 + " is equal to " + testString2 + "? " +
testString1.compare(testString2) );
var testString1 = "Bob", testString2 = "Bob";
document.write("Is " + testString1 + " is equal to " + testString2 + "? " +
testString1.compare(testString2) );
produce
Copyright © 1998-2002 Roaring Fork Software. All rights reserved.