mirror of
https://github.com/esp8266/Arduino.git
synced 2025-07-30 16:24:09 +03:00
Run new astyle formatter against all the examples
This commit is contained in:
@ -1,14 +1,14 @@
|
||||
/*
|
||||
String length()
|
||||
|
||||
Examples of how to use length() in a String.
|
||||
String length()
|
||||
|
||||
Examples of how to use length() in a String.
|
||||
Open the Serial Monitor and start sending characters to see the results.
|
||||
|
||||
|
||||
created 1 Aug 2010
|
||||
by Tom Igoe
|
||||
|
||||
|
||||
http://arduino.cc/en/Tutorial/StringLengthTrim
|
||||
|
||||
|
||||
This example code is in the public domain.
|
||||
*/
|
||||
|
||||
@ -32,7 +32,7 @@ void loop() {
|
||||
while (Serial.available() > 0) {
|
||||
char inChar = Serial.read();
|
||||
txtMsg += inChar;
|
||||
}
|
||||
}
|
||||
|
||||
// print the message and a notice if it's changed:
|
||||
if (txtMsg.length() != lastStringLength) {
|
||||
@ -41,9 +41,9 @@ void loop() {
|
||||
// if the String's longer than 140 characters, complain:
|
||||
if (txtMsg.length() < 140) {
|
||||
Serial.println("That's a perfectly acceptable text message");
|
||||
}
|
||||
}
|
||||
else {
|
||||
Serial.println("That's too long for a text message.");
|
||||
Serial.println("That's too long for a text message.");
|
||||
}
|
||||
// note the length for next time through the loop:
|
||||
lastStringLength = txtMsg.length();
|
||||
|
Reference in New Issue
Block a user