Hello,

There is several method to do so... depending of the context of your needs... if your error msg is at the beginning of the line, in the input text or alone...

You can use extract:

set mystring = "ERRORMSG"

write $extract(mystring,3,*), !

see: https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...

this method would not be used if your input string does not start with "ERRORMSG"

if you know exactly that you want to remove ER from ERRORMSG you can use $replace

set mystring = "this is an ERRORMSG"

write $replace(mystring, "ERRORMSG", "RORMSG"), !

see: https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...

you can use a $piece : https://docs.intersystems.com/latest/csp/docbook/DocBook.UI.Page.cls?KEY...

set mystring = "this is an ERRORMSG"

set textToRemove = "ER"

write $piece(mystring,textToRemove)_$piece(mystring,textToRemove,2), !

Though this last method would have a problem is the string "ER" is repeated in the input string

I hope this help

Cheers,

Jacques