比如我要将一个字符串'123   4   56 7  89 '中的多个空格换成一个'123 4 56 7 89'怎么实现?

解决方案 »

  1.   

    --是这个问题吧,居然开俩帖子,我一并回答了吧。s = s.replaceAll("两个空格","一个空格");     
      

  2.   

    --这是SQL SERVER 用法,上面的那个是JAVA用法UPDATE TABLE_A SET COLUMN_A=REPLACE(COLUMN_A,'  ',' ')
      

  3.   


    ---可以用正则表达式,regexp_replace函数
    SQL> select
      2    regexp_replace('a              b    c d', '[[:space:]]*', ' ')
      3  from dual;
     
    REGEXP_REPLACE('ABCD','[[:SPAC
    ------------------------------
     a  b  c  d