How do I convert std::string to String?
I know that in a perfect world I use std::string for everything but in this case I actually need to convert std::string to String.
With standard cpp I have seen people use <msclr\marshal.h> but until now I haven’t found the platformIO equivalent. Is there any other way Im forgetting about?
Im pretty new to PlattformIO so any kind of help would be much appreciated
You can get the std::string’s C-string (const char* via calling c_str() on the object, then feed that in the constructor of String. This will cause double memory usage, String will copy it into a newly allocated buffer. (Henc why equalization is kinda important).