From 1c68d02924b9f9ed52f536d5397d996586eaab62 Mon Sep 17 00:00:00 2001 From: ruggi99 Date: Mon, 15 Jul 2019 16:52:05 +0200 Subject: [PATCH] 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". --- cores/esp8266/WString.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/cores/esp8266/WString.h b/cores/esp8266/WString.h index 48b96f08f..558d1da85 100644 --- a/cores/esp8266/WString.h +++ b/cores/esp8266/WString.h @@ -82,6 +82,12 @@ class String { 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 // invalid, or if the memory allocation fails, the string will be