Hi,
I am trying to replace all the characters 'XX,' to '' (Empty) using the Convert function..As I underatand it replaces each character seperately and hence my output is not as expected.
I want to change "XX,XX,XX,6,XX,7" to "6,7"
Any other way to replace this entire set in one go?
Thanks,
NV
Convert Function - Mulitple Characters as a set for replace
Moderators: chulett, rschirm, roy
-
- Participant
- Posts: 597
- Joined: Fri Apr 29, 2005 6:19 am
- Location: Singapore
-
- Participant
- Posts: 597
- Joined: Fri Apr 29, 2005 6:19 am
- Location: Singapore
-
- Participant
- Posts: 54607
- Joined: Wed Oct 23, 2002 10:52 pm
- Location: Sydney, Australia
- Contact:
Convert works one character at a time.
That it worked for you was pure luck - all you got was each "X" converted to "A". Therefore "XX" would have been converted to "AA".
That it worked for you was pure luck - all you got was each "X" converted to "A". Therefore "XX" would have been converted to "AA".
IBM Software Services Group
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
Any contribution to this forum is my own opinion and does not necessarily reflect any position that IBM may hold.
-
- Participant
- Posts: 597
- Joined: Fri Apr 29, 2005 6:19 am
- Location: Singapore
As Ray told, convert works on one character at a time. If you are fine with using convert, then just to let you know... you can replace that convert with another trim too !!
one trimA to remove all X and another trimR to remove unwanted commas.
Or you could correct your statement to Trim(Convert('X','',ARG),',','R')
one trimA to remove all X and another trimR to remove unwanted commas.
Or you could correct your statement to Trim(Convert('X','',ARG),',','R')
Kandy
_________________
Try and Try again…You will succeed atlast!!
_________________
Try and Try again…You will succeed atlast!!