String::equalsIgnoreCase() \ Language (API) \ Wiring ALPHA 1.0
Author: Hernando Barragán
Description: Wiring is an electronic sketchbook and hardware electronics for developing ideas. It is a context for learning fundamentals of computer programming and prototyping with electronics within the context of the electronic arts.
Keywords: Wiring, Processing, Interactive Media, Electronic Arts, Programming, C, C++, Hernando Barragán

Search wiring.org.co:

Reference for Wiring version 0023+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.

Class | String
Name | ### equalsIgnoreCase()
Examples |
    String str1 = String("CCCP");
    String str2 = String("ccCP");
    // Tests to see if str1 is equal to str2
    if(str1.equalsIgnoreCase(str2) == true) {
      Serial.println("Equal");  // They are equal ignoring case differences so this line will print
    } else {
      Serial.println("Not equal");
    }
    String str1 = String("CCCP");
    String srt3 = String("cccp");
    // Tests to see if str1 is equal to str3

    void setup() {
      Serial.begin(9600);
      if(str1.equalsIgnoreCase(str3) == true) {
        Serial.println("Equal");  // They are equal ignoring case differences so this line will print
      }
      else {
        Serial.println("Not equal");
      }
    }

    void loop() {
      // Nothing for loop()
    }
Description | Compares two strings to see if they are equal ignoriong case differences. This method is necessary because it's not possible to compare strings using the equality operator (==). Returns true if the strings are the same and false if they are not.
Syntax |
    equalsIgnoreCase(str)
Parameters |
str | String: any valid String
Returns | boolean
Usage | Application

Updated on November 01, 2009 01:03:39pm PST