Loading...

Tutorial.StringComparisonOperators History

Hide minor edits - Show changes to markup

May 02, 2012, at 09:56 AM by Scott Fitzgerald -
Changed line 47 from:

(:source http://github.com/arduino/Arduino/raw/master/build/shared/examples/8.Strings/StringComparisonOperators/StringComparisonOperators.ino lang=arduino tabwidth=4:)

to:

(:source http://github.com/arduino/Arduino/raw/master/build/shared/examples/08.Strings/StringComparisonOperators/StringComparisonOperators.ino lang=arduino tabwidth=4:)

November 15, 2011, at 10:25 PM by Scott Fitzgerald -
Changed line 47 from:

(:source http://github.com/arduino/Arduino/raw/master/build/shared/examples/8.Strings/StringComparisonOperators/StringComparisonOperators.pde lang=arduino tabwidth=4:)

to:

(:source http://github.com/arduino/Arduino/raw/master/build/shared/examples/8.Strings/StringComparisonOperators/StringComparisonOperators.ino lang=arduino tabwidth=4:)

September 19, 2010, at 05:34 PM by Christian Cerrito -
Changed lines 3-4 from:

String Comparison Operatprs

to:

String Comparison Operators

Deleted lines 6-10:

(:div class=BOM :)

Hardware Required

No external hardware is required. (:divend:)

Added lines 29-33:

(:div class=BOM :)

Hardware Required

  • Arduino Board

(:divend:)

Deleted line 34:
Changed lines 36-40 from:

There is no circuit for this example.

to:

There is no circuit for this example, though your Arduino must be connected to your computer via USB.

image developed using Fritzing. For more circuit examples, see the Fritzing project page

Added line 43:
September 16, 2010, at 04:44 PM by Tom Igoe -
Changed line 43 from:
 (:source http://github.com/arduino/Arduino/raw/master/build/shared/examples/8.Strings/StringComparisonOperators/StringComparisonOperators.pde lang=arduino  tabwidth=4:)
to:

(:source http://github.com/arduino/Arduino/raw/master/build/shared/examples/8.Strings/StringComparisonOperators/StringComparisonOperators.pde lang=arduino tabwidth=4:)

September 16, 2010, at 04:44 PM by Tom Igoe -
Changed lines 15-16 from:

if (stringOne.equals(stringTwo)) {

to:

(:source lang=arduino tabwidth=4:)

 if (stringOne.equals(stringTwo)) {

(:sourceend:)

Changed lines 22-23 from:

if (stringOne ==stringTwo) {

to:

(:source lang=arduino tabwidth=4:)

 if (stringOne ==stringTwo) {

(:sourceend:)

August 01, 2010, at 12:17 PM by Tom Igoe -
Changed lines 23-25 from:

The greater than and less than operators evaluate strings in alphabetical order, on the first character where the two differ. So, for example "a" < "b" and "1" < "2", but @@"999"> "1000" because 9 comes after 1.

to:

The greater than and less than operators evaluate strings in alphabetical order, on the first character where the two differ. So, for example "a" < "b" and "1" < "2", but "999"> "1000" because 9 comes after 1.

August 01, 2010, at 12:17 PM by Tom Igoe -
Changed lines 12-13 from:

The operator == and the function @@equals() perform identically. It's just a matter of which you prefer. So

to:

The operator == and the function equals() perform identically. It's just a matter of which you prefer. So

August 01, 2010, at 12:16 PM by Tom Igoe -
Added lines 1-54:

Examples > Strings

String Comparison Operatprs

The String comparison operators, ==, !=,>, < ,>=, <= , and the functionsequals() and equalsIgoreCase() allow you to make alphabetic comparisons between Strings. They're useful for sorting and alphabetizing, among other things.

(:div class=BOM :)

Hardware Required

No external hardware is required. (:divend:)

The operator == and the function @@equals() perform identically. It's just a matter of which you prefer. So

(:div class=code :) if (stringOne.equals(stringTwo)) {

is identical to

if (stringOne ==stringTwo) {

(:divend:)

The greater than and less than operators evaluate strings in alphabetical order, on the first character where the two differ. So, for example "a" < "b" and "1" < "2", but @@"999"> "1000" because 9 comes after 1.

Caution: String comparison operators can be confusing when you're comparing numeric strings, because you're used to thinking of them as numbers, not strings. If you have to compare numbers, compare them as ints, floats, or longs, and not as Strings.

Circuit

(:div class=circuit :) There is no circuit for this example. (:divend:)

Code

(:div class=code :)

(:source




Bookmark and Share