1
0
mirror of https://github.com/esp8266/Arduino.git synced 2025-04-19 23:22:16 +03:00

Create empty method for String class (#6293)

* Created empty method

* Changed method name from "empty" to "isEmpty". Created a new method to empty a string

* Changed method name from "empty" to "clear".
This commit is contained in:
ruggi99 2019-07-15 16:52:05 +02:00 committed by Develo
parent 52f8c62b81
commit 1c68d02924

View File

@ -82,6 +82,12 @@ class String {
return 0; return 0;
} }
} }
inline void clear(void) {
setLen(0);
}
inline bool isEmpty(void) const {
return length() == 0;
}
// creates a copy of the assigned value. if the value is null or // creates a copy of the assigned value. if the value is null or
// invalid, or if the memory allocation fails, the string will be // invalid, or if the memory allocation fails, the string will be