From 47bcf07f5e7b0d07f0fcef64490d65333c570f7d Mon Sep 17 00:00:00 2001 From: Martino Facchin Date: Mon, 30 Nov 2015 13:23:57 +0100 Subject: [PATCH] fix StringIndexOf example logic and wording --- .../examples/08.Strings/StringIndexOf/StringIndexOf.ino | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/build/shared/examples/08.Strings/StringIndexOf/StringIndexOf.ino b/build/shared/examples/08.Strings/StringIndexOf/StringIndexOf.ino index ce29a5757..584b15795 100644 --- a/build/shared/examples/08.Strings/StringIndexOf/StringIndexOf.ino +++ b/build/shared/examples/08.Strings/StringIndexOf/StringIndexOf.ino @@ -43,22 +43,22 @@ void loop() { stringOne = ""; int firstListItem = stringOne.indexOf("
  • "); - int secondListItem = stringOne.indexOf("item", firstListItem + 1); - Serial.println("The index of the second list item in the string " + stringOne + " is " + secondClosingBracket); + int secondListItem = stringOne.indexOf("
  • ", firstListItem + 1); + Serial.println("The index of the second list tag in the string " + stringOne + " is " + secondListItem); // lastIndexOf() gives you the last occurrence of a character or string: int lastOpeningBracket = stringOne.lastIndexOf('<'); Serial.println("The index of the last < in the string " + stringOne + " is " + lastOpeningBracket); int lastListItem = stringOne.lastIndexOf("
  • "); - Serial.println("The index of the last list item in the string " + stringOne + " is " + lastListItem); + Serial.println("The index of the last list tag in the string " + stringOne + " is " + lastListItem); // lastIndexOf() can also search for a string: stringOne = "

    Lorem ipsum dolor sit amet

    Ipsem

    Quod

    "; int lastParagraph = stringOne.lastIndexOf("