YoYoGames/GameMaker-HTML5

`string_trim_end` does nothing

Closed this issue · 1 comments

string_trim_end does nothing
test code:

var _str = string_format(1, 100, 10)
var _str = string_trim_end(_str, ["0"]);
var _str = string_trim_end(_str, ["."]);
var _str = string_trim_start(_str, [" "]);
show_debug_message(_str)

Narrowed this down to a problem with the g_EscapeRegexRE regular expression - the original expression blocked a range of characters between \ and /, including all numbers and some symbols. Using this regular expression instead appears to fix it: new RegExp("[\\/\\-\\\\^$*+?.()|[\\]{}]", "g");

I've also opened a pull request with this fix, it appears to work nicely