The Wiring 1.0 _ALPHA_ Reference is a work in progress.
If you see any errors or have any comments, please write to: hbarragan [at] uniandes.edu.co
Class
String
Name
indexOf()
Examples
String str = "CCCP";
int p1 = str.indexOf("C");
int p2 = str.indexOf("P");
int p3 = str.indexOf("CP");
Serial.println(p1, DEC); // Prints 0
Serial.println(p2, DEC); // Prints 3
Serial.println(p3, DEC); // Prints 2
Description
Tests to see if a substring is embedded in a string and returns the index position of the first occurrence of the substring defined in the str parameter. If the str parameter is not found in the string, -1 is returned.