Page 1 of 1

function to trim commas between a string

Posted: Thu Sep 27, 2012 3:44 am
by phanikumar
Hi All,

I have a requirement where in I need to strip the commas between a string.

Example:

Input:
EQ001,,EQ002,EQ003,,EQ020

The output should be like

EQ001,EQ002,EQ003,EQ020

Any suggestions would be greatly helpful.

Regards
Kumar

Posted: Thu Sep 27, 2012 4:01 am
by ray.wurlod
Use the pxEreplace() function you can find here on DSXchange.

Posted: Thu Sep 27, 2012 4:32 am
by bhasds
Hi Phanikumar,

I was able to get the desired output with-

Code: Select all

Convert(" ",",",CompactWhiteSpace(Convert(","," ","colname")))

Posted: Thu Sep 27, 2012 6:39 am
by PhilHibbs
ray.wurlod wrote:Use the pxEreplace() function you can find here on DSXchange.
I would wait until this thread is resolved before using pxEreplace.