Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I convert a UE4 FString into a string?

TextLine2 needs to be a regular string however I receive the error no instance of constructor matches the argument list.

void AAH_Ver1_2::GetEachTextFromLine(FString TextLine1)
{
    string TextLine2 = TextLine1;
    istringstream iss(TextLine2);
}
like image 555
Jeremiah Hill Avatar asked Nov 29 '25 08:11

Jeremiah Hill


1 Answers

You can convert an FString to an std::string with the TCHAR_TO_UTF8 macro:

std::string const s = TCHAR_TO_UTF8(*fstring);
like image 150
bitmask Avatar answered Dec 01 '25 22:12

bitmask