Skip to content

Commit 2d13ebb

Browse files
Ivan-Perezcmaglie
authored andcommitted
WString.h: allow modifying the string while iterating
1 parent 69421dc commit 2d13ebb

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

cores/arduino/WString.h

Lines changed: 3 additions & 1 deletion
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)