# Concatenating FStrings

**URL:** <https://forums.unrealengine.com/t/concatenating-fstrings/361521>\
**Category:** Programming & Scripting\
**Tags:** unreal-engine\
**Created:** [June 21, 2016, 7:51am UTC](https://forums.unrealengine.com/t/concatenating-fstrings/361521 "2016-06-21T07:51:59Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![anonymous\_user\_7e4caf27](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7e4caf27](https://forums.unrealengine.com/u/anonymous_user_7e4caf27)\
**Post date:** [June 21, 2016, 7:51am UTC](https://forums.unrealengine.com/t/concatenating-fstrings/361521/1 "2016-06-21T07:51:59Z")

</div>

I am baffled by the FString::Format method. My desired goal is to concatenate three float values into an FString (separated by commas). Example: from `0.5f`, `1.5f` and `76.1f` create `"0.5,1.5,76.1"`.

For some reason concatenating FString is not allowed `(FString::SanitizeFloat(0.5f) + FString(",") doesn't work)` and I was unable to make the FString::Format method work `(FString::Format(&FString("{0},"), 1.5f) throws bad arguments error)`.

I am aware of the `Append` function, but that seems very unoptimized when concatenating for example 5 strings.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e1600e71](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e1600e71](https://forums.unrealengine.com/u/anonymous_user_e1600e71)\
**Post date:** [June 21, 2016, 8:50am UTC](https://forums.unrealengine.com/t/concatenating-fstrings/361521/2 "2016-06-21T08:50:34Z")

</div>

I just tested `	FString Toto = FString::SanitizeFloat(0.5f) + FString("321"); `  
and it compiles.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7e4caf27](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7e4caf27](https://forums.unrealengine.com/u/anonymous_user_7e4caf27)\
**Post date:** [June 21, 2016, 8:53am UTC](https://forums.unrealengine.com/t/concatenating-fstrings/361521/3 "2016-06-21T08:53:17Z")

</div>

What version are you currently using? Your snippet throws me the same compile time error as the first method that I’ve tried.

```
c:\program files (x86)\epic games\4.11\engine\source\runtime\core\public\Misc/OutputDevice.h(382): error C2665: 'CheckVA': none of the 11 overloads could convert all the argument types

```

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e1600e71](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e1600e71](https://forums.unrealengine.com/u/anonymous_user_e1600e71)\
**Post date:** [June 21, 2016, 9:12am UTC](https://forums.unrealengine.com/t/concatenating-fstrings/361521/4 "2016-06-21T09:12:26Z")

</div>

I’m using 4.12.

I just google this `CheckVA` weird thing. I suggest you look at this post [How can I resolve the error: "'CheckVA' : none of the 11 overloads could convert all the argument types"? - Programming & Scripting - Epic Developer Community Forums](https://answers.unrealengine.com/questions/41839/checkva-none-of-the-11-overloads-could-convert-all.html)

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7e4caf27](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7e4caf27](https://forums.unrealengine.com/u/anonymous_user_7e4caf27)\
**Post date:** [June 21, 2016, 9:22am UTC](https://forums.unrealengine.com/t/concatenating-fstrings/361521/5 "2016-06-21T09:22:55Z")

</div>

Uh. That suggests the issue may be somewhere else, but that is rather odd considering that the game compiles when FString concatenations are removed.  
Thanks for your effort, though.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e1600e71](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e1600e71](https://forums.unrealengine.com/u/anonymous_user_e1600e71)\
**Post date:** [June 21, 2016, 9:24am UTC](https://forums.unrealengine.com/t/concatenating-fstrings/361521/6 "2016-06-21T09:24:33Z")

</div>

Are you using Visual Studio 2015 by the way ? Cause the post talks about C++11 which is not supported in old visual studio version.

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_7e4caf27](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_7e4caf27](https://forums.unrealengine.com/u/anonymous_user_7e4caf27)\
**Post date:** [June 21, 2016, 9:58am UTC](https://forums.unrealengine.com/t/concatenating-fstrings/361521/7 "2016-06-21T09:58:19Z")

</div>

Switching to newer VS solved the issue, but that is strange since VS doesn’t have anything to do with the build process (only invokes UE programs that do the actuall build).

---

<div class="post-metadata">

**Author:** ![anonymous\_user\_e1600e71](https://d3kjluh73b9h9o.cloudfront.net/original/4X/2/8/5/28502927f1d97ba1051b3b47ccfe17233bf41ef0.png) [@anonymous\_user\_e1600e71](https://forums.unrealengine.com/u/anonymous_user_e1600e71)\
**Post date:** [June 21, 2016, 10:01am UTC](https://forums.unrealengine.com/t/concatenating-fstrings/361521/8 "2016-06-21T10:01:51Z")

</div>

I don’t think Epic Games actually re-developped their own C++ compiler. I think they use the Visual Studio one.
