3

How can I convert a char array to String with Arduino?

char charArray[];
String string = String(charArray); // This doesn't work

1 Answer 1

5

A String type is initialized similarly to a C constructor:

String randomString(charArray);

There are various overloads of the String constructor including char collections.

Doc:

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.