Skip to main content

The "string_trim_right" Function

Syntax#

string_trim_right(str, [filter]);
ArgumentTypeDescription
strstringThe string to modify
[filter]stringOptional: A custom list of characters to be trimmed

Description#

Removes spaces from the right side of the string and returns the trimmed result.

If a filter is supplied, any character in the filter string will be trimmed instead. (To also trim spaces, include a space in the filter string.)

Example#

var notes = " +[do, re, mi, fa, so, la, ti, do] % ";
notes = string_trim_right(notes, " ]%");
draw_text(x, y, notes);