Jeremiah Hill
Jeremiah Hill

Reputation: 23

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);
}

Upvotes: 2

Views: 8796

Answers (1)

bitmask
bitmask

Reputation: 34654

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

std::string const s = TCHAR_TO_UTF8(*fstring);

Upvotes: 3

Related Questions