Skip to content

Commit 1c68d02

Browse files
ruggi99devyte
authored andcommitted
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".
1 parent 52f8c62 commit 1c68d02

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

cores/esp8266/WString.h

+6
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,12 @@ class String {
8282
return 0;
8383
}
8484
}
85+
inline void clear(void) {
86+
setLen(0);
87+
}
88+
inline bool isEmpty(void) const {
89+
return length() == 0;
90+
}
8591

8692
// creates a copy of the assigned value. if the value is null or
8793
// invalid, or if the memory allocation fails, the string will be

0 commit comments

Comments
 (0)