Exposed String.Remove() function to ZScript

https://forum.zdoom.org/viewtopic.php?t=58402
This commit is contained in:
alexey.lysiuk 2017-11-12 14:44:21 +02:00
parent 285834ae5b
commit 5d83ee5e89
2 changed files with 10 additions and 0 deletions

View File

@ -1225,6 +1225,15 @@ DEFINE_ACTION_FUNCTION(FStringStruct, Truncate)
return 0;
}
DEFINE_ACTION_FUNCTION(FStringStruct, Remove)
{
PARAM_SELF_STRUCT_PROLOGUE(FString);
PARAM_UINT(index);
PARAM_UINT(remlen);
self->Remove(index, remlen);
return 0;
}
// CharAt and CharCodeAt is how JS does it, and JS is similar here in that it doesn't have char type as int.
DEFINE_ACTION_FUNCTION(FStringStruct, CharAt)
{

View File

@ -684,6 +684,7 @@ struct StringStruct native
native String Left(int len) const;
native String Mid(int pos = 0, int len = 2147483647) const;
native void Truncate(int newlen);
native void Remove(int index, int remlen);
native String CharAt(int pos) const;
native int CharCodeAt(int pos) const;
native String Filter();