FString::ParseIntoArray 8
Breaks up a delimited string into elements of a string array.
TArray<FString> Out;
SomeString.ParseIntoArray(Out,TEXT(","),true);
Out array will be filled with sub-strings, 2nd argument is separator string (in this case “,”) which tells function in what places sperate the string. It’s quite heavy function so don’t use it on long text.
If you have only one or few spectator in string there more efficient functions:
FString::Split 8
Splits this string at given string position case sensitive.
FString Left, Right;
SomeString.Split(TEXT(","),&Left,&Right);
Left will be string left from first founf separator (1st argument) Right will be string on the Right of separator
You can also use RemoveFromStart and RemoveFromEnd if you want to remove any prefix or suffix
RemoveFromStart 2
Overload list
RemoveFromEnd 1
Overload list
There also many functions to split based on character index, explore FString API reference for more:
FString 1
A dynamically sizeable string.
https://forums.unrealengine.com/t/splitting-a-string-by-another-string/402117
'Development > Unreal Engine 4, 5' 카테고리의 다른 글
Hokuyo Distance Data in Unreal Engine 4 (0) | 2022.03.23 |
---|---|
FString (Hex String) to TArray<uint8> (byteArray) (0) | 2022.03.23 |
Unreal Logging (0) | 2022.03.22 |
FString::ParseIntoArray - String 쪼개기(?) (0) | 2022.03.21 |
How to include any Third-Party library in Unreal Engine 4 (0) | 2022.03.17 |