String equals


String::equals() \ Language (API) \ Wiring ALPHA 1.0 Search wiring.org.co: Language (A-Z) \ Libraries \ Environment \ Learning \ Hardware Reference for Wiring version 0027+. 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 equals() Examples void setup() { Serial.begin(9600); String str1 = String("CCCP"); String str2 = String("CCCP"); // Tests to see if str1 is equal to str2 if(str1.equals(str2) == true) { // They are equal so this line will print Serial.println("Equal"); } else { Serial.println("Not equal"); } } void loop() { }String str1 = String("CCCP"); String str3 = String("CCCP"); // Tests to see if str1 is equal to str3 void setup() { Serial.begin(9600); if(str1.equals(str3) == true) { // They are equal so this line will print Serial.println("Equal"); } else { Serial.println("Not equal"); } } void loop() { // Nothing for loop() } Description Compares two strings to see if they are the same. 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 equals(str) Parameters str String: any valid String Returns boolean Usage Application Updated on September 16, 2010 11:34:12pm PDT Wiring is an open project initiated by Hernando Barragán. It is developed by a small team of volunteers. © Info, Processing © Info

Wyszukiwarka

Podobne podstrony:
String equals
String equals
String equalsIgnoreCase
String concat
String indexOf
STRING (3)
stringappendoperator
Strings LWB
StringSeqHolder
strings01
String substring
strings SP
function mysql real escape string
STRINGS
StringValueExp
StringClass

więcej podobnych podstron