diff --git a/cores/esp32/WString.h b/cores/esp32/WString.h index 38bd116f4ae6..9111d9aac11c 100644 --- a/cores/esp32/WString.h +++ b/cores/esp32/WString.h @@ -203,8 +203,20 @@ class String { unsigned char equalsIgnoreCase(const String &s) const; unsigned char equalsConstantTime(const String &s) const; unsigned char startsWith(const String &prefix) const; + unsigned char startsWith(const char *prefix) const { + return this->startsWith(String(prefix)); + } + unsigned char startsWith(const __FlashStringHelper *prefix) const { + return this->startsWith(String(prefix)); + } unsigned char startsWith(const String &prefix, unsigned int offset) const; unsigned char endsWith(const String &suffix) const; + unsigned char endsWith(const char *suffix) const { + return this->endsWith(String(suffix)); + } + unsigned char endsWith(const __FlashStringHelper * suffix) const { + return this->endsWith(String(suffix)); + } // character access char charAt(unsigned int index) const; @@ -238,7 +250,22 @@ class String { // modification void replace(char find, char replace); - void replace(const String& find, const String& replace); + void replace(const String &find, const String &replace); + void replace(const char *find, const String &replace) { + this->replace(String(find), replace); + } + void replace(const __FlashStringHelper *find, const String &replace) { + this->replace(String(find), replace); + } + void replace(const char *find, const char *replace) { + this->replace(String(find), String(replace)); + } + void replace(const __FlashStringHelper *find, const char *replace) { + this->replace(String(find), String(replace)); + } + void replace(const __FlashStringHelper *find, const __FlashStringHelper *replace) { + this->replace(String(find), String(replace)); + } void remove(unsigned int index); void remove(unsigned int index, unsigned int count); void toLowerCase(void);