How do i split a string to start on new line? "\n" not working! (Simple Question)

How do i get a string to start on a new line, apparently
is supposed to work but it doesn’t for me.

“Hello there
blah”

becomes

“Hello thereblah”

Am i missing something?

works in C++'s strings.

Try a Shift+Enter on blueprints.

2 Likes

Yes, but is there any other way to do it in c++ because i have my code setup there?

I’ve found that for some things adding <br> will cause a new line.

This work for TextRenderComponents for example.

I’ve solved my problem, here is my method for anyone who cares.

Line_terminator

UE4 has a macro called LINE_TERMINATOR, globally accessible.

You can use that where you’d normally use ’
’ to get the desired result

:heart:

Rama

5 Likes

This it’s work for me

UE4 has a macro for ’ '?

https://forums.unrealengine.com/core/image/png;base64

FString FileContent;
//Read the csv file
FFileHelper::LoadFileToString(FileContent, *fPath);
TArray<FString> CSVLines;
const TCHAR* Terminators[] = { L"\r", L"\n" }; //LINE_TERMINATOR
FileContent.ParseIntoArray(CSVLines, Terminators, 2);
1 Like

shift+enter works in BP

image

in cpp on 5.5 there is ParseIntoArrayLines for FStrings
beware of the warning about using it for short strings