【问题标题】:How do I convert a UE4 FString into a string?如何将 UE4 FString 转换为字符串?
【发布时间】:2020-07-18 21:04:35
【问题描述】:

TextLine2 需要是常规字符串,但是我收到错误 no instance of constructor matches the argument list.

void AAH_Ver1_2::GetEachTextFromLine(FString TextLine1)
{
    string TextLine2 = TextLine1;
    istringstream iss(TextLine2);
}

【问题讨论】:

  • 你试过谷歌搜索“ue4 fstring to string”吗? answers.unrealengine.com 有许多主题解释什么是 Fstring 以及它是如何转换的。

标签: c++ string unreal-engine4 data-conversion


【解决方案1】:

您可以使用TCHAR_TO_UTF8 宏将FString 转换为std::string

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2018-11-23
    • 1970-01-01
    • 2011-12-31
    • 2018-04-30
    • 2014-05-26
    • 1970-01-01
    相关资源
    最近更新 更多