Exposed string split functionality to ZScript
https://forum.zdoom.org/viewtopic.php?t=58114
This commit is contained in:
parent
3b3f2e20cc
commit
c4865d2bb6
2 changed files with 17 additions and 0 deletions
|
|
@ -1293,3 +1293,13 @@ DEFINE_ACTION_FUNCTION(FStringStruct, ToDouble)
|
|||
PARAM_SELF_STRUCT_PROLOGUE(FString);
|
||||
ACTION_RETURN_FLOAT(self->ToDouble());
|
||||
}
|
||||
|
||||
DEFINE_ACTION_FUNCTION(FStringStruct, Split)
|
||||
{
|
||||
PARAM_SELF_STRUCT_PROLOGUE(FString);
|
||||
PARAM_POINTER(tokens, TArray<FString>);
|
||||
PARAM_STRING(delimiter);
|
||||
PARAM_INT_DEF(keepEmpty);
|
||||
self->Split(*tokens, delimiter, static_cast<FString::EmptyTokenType>(keepEmpty));
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue