I haven’t found a clean way to do either, yet. Any clues?
juce::String js = “something to try”;
std::string ss = (const char*) js;
and the opposite
std::string ss = “another try”;
juce::String js = (const char*) ss.c_str();
and std::string operator in the juce::String would not be hard to add… at all…
I know it’s ten years later but I can’t resist updating this thread to help newcomers like myself in the future.
This may not have been supported ten years ago but it looks to be in now!
String::String (const std::string & )
Creates a string from a UTF-8 encoded std::string.
std::string String::toStdString () const
goes back the other way.