File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed
build/shared/examples/08.Strings/StringIndexOf Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -43,22 +43,22 @@ void loop() {
4343
4444 stringOne = " <UL><LI>item<LI>item<LI>item</UL>" ;
4545 int firstListItem = stringOne.indexOf (" <LI>" );
46- int secondListItem = stringOne.indexOf (" item " , firstListItem + 1 );
47- Serial.println (" The index of the second list item in the string " + stringOne + " is " + secondClosingBracket );
46+ int secondListItem = stringOne.indexOf (" <LI> " , firstListItem + 1 );
47+ Serial.println (" The index of the second list tag in the string " + stringOne + " is " + secondListItem );
4848
4949 // lastIndexOf() gives you the last occurrence of a character or string:
5050 int lastOpeningBracket = stringOne.lastIndexOf (' <' );
5151 Serial.println (" The index of the last < in the string " + stringOne + " is " + lastOpeningBracket);
5252
5353 int lastListItem = stringOne.lastIndexOf (" <LI>" );
54- Serial.println (" The index of the last list item in the string " + stringOne + " is " + lastListItem);
54+ Serial.println (" The index of the last list tag in the string " + stringOne + " is " + lastListItem);
5555
5656
5757 // lastIndexOf() can also search for a string:
5858 stringOne = " <p>Lorem ipsum dolor sit amet</p><p>Ipsem</p><p>Quod</p>" ;
5959 int lastParagraph = stringOne.lastIndexOf (" <p" );
6060 int secondLastGraf = stringOne.lastIndexOf (" <p" , lastParagraph - 1 );
61- Serial.println (" The index of the second last paragraph tag " + stringOne + " is " + secondLastGraf);
61+ Serial.println (" The index of the second to last paragraph tag " + stringOne + " is " + secondLastGraf);
6262
6363 // do nothing while true:
6464 while (true );
You can’t perform that action at this time.
0 commit comments