Skip to content

Commit b8c56da

Browse files
Add String(const uint8_t *, unsigned int) constructor
This allows creating a String from a uint8_t[] or uint8_t* as well, without having to add explicit casts.
1 parent 75c1db5 commit b8c56da

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Diff for: api/String.h

+1
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ class String
6969
// be false).
7070
String(const char *cstr = "");
7171
String(const char *cstr, unsigned int length);
72+
String(const uint8_t *cstr, unsigned int length) : String((const char*)cstr, length) {}
7273
String(const String &str);
7374
String(const __FlashStringHelper *str);
7475
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)

0 commit comments

Comments
 (0)