adventuregamestudio / ags

AGS editor and engine source code
Other
707 stars 159 forks source link

Script API: implement String.Remove(from, count) #2539

Open ivan-mogilko opened 2 months ago

ivan-mogilko commented 2 months ago

Sometimes there's a case where you want to cut a piece of string in the middle. This is doable via mix of Substring and Append, but would be nice to have a function that just does this itself.

Suggested prototype:

String String.Remove(int startIndex, int count = -1);

if count is passed as < 0 (default), then this will remove everything starting with startIndex.

ericoporto commented 1 month ago

Afaict the idea is to implement exactly https://learn.microsoft.com/en-us/dotnet/api/system.string.remove?view=net-8.0