Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 721ed20

Browse filesBrowse files
matthijskooijmanaentinger
authored andcommitted
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 87cb279 commit 721ed20
Copy full SHA for 721ed20

File tree

1 file changed

+1
-0
lines changed
Filter options

1 file changed

+1
-0
lines changed

‎api/String.h

Copy file name to clipboardExpand all lines: api/String.h
+1Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,7 @@ class String
6666
// be false).
6767
String(const char *cstr = "");
6868
String(const char *cstr, unsigned int length);
69+
String(const uint8_t *cstr, unsigned int length) : String((const char*)cstr, length) {}
6970
String(const String &str);
7071
String(const __FlashStringHelper *str);
7172
#if __cplusplus >= 201103L || defined(__GXX_EXPERIMENTAL_CXX0X__)

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.