How to add STRING ?

Hi, i have 3 variables. I wan add this.
Ex.
New Var 5 = Hello
New Var 4 = BIG
New Var 3 = World

Result = Print String “Hello BIG World”

You can use “Append” node for that :

5 Likes

Append String, also Build String which is a bit more feature filled than append but requires a type

Append them together.

Append is the semi-correct way.

2016-02-03 22_41_33-ContentExamples - Unreal Editor.png

However, note that the strings are directly attached, with no space in between (which judging by the post is what you want). For that you could simply add multiple pins to the Append node and fill every other slot with just a space character in it.

For some complementary string building, BuildString is an useful node to represent variables with filler text in between.

Another reply mentioned this as a possible solution, however, as also pointed out, there is no version of BuildString that actually takes a string itself. No real biggy, you can just use a combination of BuildString and Append to achieve the desired string. It’s nifty for minor string building stuff, but once you need a string with several more variables in it, chaining together several BuildString nodes can be quite hard to maintain. Therefore I’d also like to mention the most flexible and compact node (imo), FormatText.

For FormatText you provide a format-string, where any entry between two { curly brackets } will be exposed as a blueprint FText pin. Super useful, since most basic object types (e.g. Int, Float, Bool, even other strings) can easily be converted to an FText representation, even with added formatting such as specifying the number of decimal places for floats (do you want to show 10.52 or just 10.5 or just 10 or round to 11? easy). FTexts are also recommended to be the type for any strings displayed to the user as they they are designed to integrate with localization and can be displayed in various ways depending on the user. Even if you are not using localization it can’t hurt that bad. :slight_smile:

4 Likes