Skip to content

Commit f68a722

Browse files
Ivan-Perezcmaglie
authored andcommitted
WString.h: allow modifying the string while iterating
1 parent 07fa22f commit f68a722

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

hardware/arduino/avr/cores/arduino/WString.h

+3-1
Original file line numberDiff line numberDiff line change
@@ -159,8 +159,10 @@ class String
159159
char& operator [] (unsigned int index);
160160
void getBytes(unsigned char *buf, unsigned int bufsize, unsigned int index=0) const;
161161
void toCharArray(char *buf, unsigned int bufsize, unsigned int index=0) const
162-
{getBytes((unsigned char *)buf, bufsize, index);}
162+
{ getBytes((unsigned char *)buf, bufsize, index); }
163163
const char* c_str() const { return buffer; }
164+
char* begin() { return buffer; }
165+
char* end() { return buffer + length(); }
164166
const char* begin() const { return c_str(); }
165167
const char* end() const { return c_str() + length(); }
166168

0 commit comments

Comments
 (0)