Question on right-trim()

Posted by byoung2735 on 03-Nov-2017 08:52

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.

Posted by Brian K. Maher on 03-Nov-2017 08:58

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

Posted by tpavlovic on 03-Nov-2017 08:57

Yes.

Posted by Brian K. Maher on 03-Nov-2017 08:58

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" */

This thread is closed