No, it doesn't... pHL7 is an object of type EnsLib.HL7.Message, not a string... and also we need to remove the trailing chars not just from the end of a segment but within segments too... note the second example below which shows the carats remaining in PID:4 (my function would remove them):

 

USER>set pHL7 = "PID|1|12345||DOE^JOHN|^^^"
 
USER>w $zstrip(pHL7,">","|^")
PID|1|12345||DOE^JOHN
USER>set pHL7 = "PID|1|12345|myval^^^|DOE^JOHN|^^^"
 
USER>w $zstrip(pHL7,">","|^")
PID|1|12345|myval^^^|DOE^JOHN
USER>