String()startsWith() \ Language (API) \ Wiring 1.0 (ALPHA)

| String

| Reference for Wiring 1.0 (ALPHA) 0017+. 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 |  | ### startsWith()
Examples |  |
    String str1 = "CCCP";
    String str2 = "CC";
    // Tests to see if str1 starts with str2
    if(str1.startsWith(str2) == true) {
      Serial.println("Starts with");  // The string starts with so this line will print
    } else {
      Serial.println("Not");
    }
Description |  | Tests if this string starts with the specified string. Returns true if the string starts with the specified string and false if not.
Syntax |  |
    startsWith(str)
    startsWith(str, offset)
Parameters |  |
str |  | String: any valid character string
offset |  | int: beginning at a specified index
Returns |  | Boolean
Usage |  | Web & Application