From 2d13ebbb3ea26db66794df9125208f60a93722e7 Mon Sep 17 00:00:00 2001 From: Ivan-Perez Date: Thu, 12 May 2016 13:27:56 +0200 Subject: WString.h: allow modifying the string while iterating --- cores/arduino/WString.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'cores') diff --git a/cores/arduino/WString.h b/cores/arduino/WString.h index 89fcaa5..de5632c 100644 --- a/cores/arduino/WString.h +++ b/cores/arduino/WString.h @@ -159,8 +159,10 @@ public: char& operator [] (unsigned int index); void getBytes(unsigned char *buf, unsigned int bufsize, unsigned int index=0) const; void toCharArray(char *buf, unsigned int bufsize, unsigned int index=0) const - {getBytes((unsigned char *)buf, bufsize, index);} + { getBytes((unsigned char *)buf, bufsize, index); } const char* c_str() const { return buffer; } + char* begin() { return buffer; } + char* end() { return buffer + length(); } const char* begin() const { return c_str(); } const char* end() const { return c_str() + length(); } -- cgit v1.2.3-18-g5258