1 Reply Latest reply: Feb 9, 2013 11:09 PM by 887479 RSS

    Replace commas with space - Can we do it without REGEXP ?

    887479
      11gR2 DB.

      Can we replace commas with a single space without using REGEXP?
      Sample String: 'To,Replace,,Comma(s),,,,with space,,,'
      Expected output:'To Replace Comma(s) with space '
        • 1. Re: Replace commas with space - Can we do it without REGEXP ?
          jeneesh
          884476 wrote:
          11gR2 DB.

          Can we replace commas with a single space without using REGEXP?
          You could do it with nested REPLACE ..
          select    replace(
                      replace(
                        replace(
                            'To,Replace,,Comma(s),,,,with space,,,',',','#$'
                               ),
                            '$#',''
                             ),
                           '#$',' '
                           ) str
          from dual;
          
          STR                           
          -------------------------------
          To Replace Comma(s) with space