Question on right-trim() - Forum - OpenEdge Development - Progress Community
 Forum

Question on right-trim()

This question is answered

Question on right-trim(), is this expected functionality?

def var c as character no-undo.

c = "foo.p".

display right-trim( c, ".p" ).

/* this displays "foo" */

c = "foop".

display right-trim( c, ".p" ).

/* dlso displays "foo", but since there is no dot P I'd have expected "foop" */

Thanks.

Verified Answer
  • right trim removes any of those individual characters, not the literal string value.
     
    def var c as character no-undo.
     
    c = "foo.p".
    display right-trim( c, ".p" ).
    /* displays "foo" */
     
    c = "foopb".
    display RIGHT-TRIM( c, "bpo" ).
    /* displays "f" */

All Replies
  • Yes.

  • right trim removes any of those individual characters, not the literal string value.
     
    def var c as character no-undo.
     
    c = "foo.p".
    display right-trim( c, ".p" ).
    /* displays "foo" */
     
    c = "foopb".
    display RIGHT-TRIM( c, "bpo" ).
    /* displays "f" */