Purpose
Remove trailing characters

Please keep in mind that this is not necessary for space characters, since they are truncated automatically when you use a GuiXT variable unless you have specified
ProcessingOption trailingSpace= "On"

Solution
We use the regexReplace option of the Set command. Since Set returns an empty string if no matching substring is found, we add an "@" at the end of the input string to force a matching string.


GuiXT
// sample value
Set V[city] "@@@@@München@@@"
	
// remove trailing @ 
Set V[city2] "&V[city]@" regex="\@*$" regexReplace="" 
	
// test message
Message "&V[city]\n&V[city2]"

Components
InputAssistant