Convert std::string to FString

Full Two Way Code

Bob is correct of course :slight_smile:

I just wrote up this code for you if you need exact code to work with!



FString UE4Str = "UE4 C++"; 

**//FString to std::string**
std::string cstr(TCHAR_TO_UTF8(*UE4Str));

**//std::string to FString**
ClientMessage(FString(cstr.c_str()));


Recall that operator* for FString gets you the inner data, which is TCHAR*

Enjoy!

Rama

PS: to run this code you need to #include <string>

3 Likes