How to remove white spaces in between a string

Discussion in 'JavaScript' started by Himi, Oct 6, 2007.

  1. #1
    Hi,
    Can some one please tell me the regexp in javascript
    to remove white spaces from between a string.
    and then convert the upper case charecters to lower case.

    I have a string of the format :

    AAAAAA AAAAA AAAAA#AAAAA AAAAA#AAA AAAA AAAA#

    Thanks,
    Himi
     
    Himi, Oct 6, 2007 IP
  2. ezpz

    ezpz Peon

    Messages:
    25
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Try

    string.replace(/\s/g, "");
    string.toLowerCase();
     
    ezpz, Oct 6, 2007 IP
  3. temp2

    temp2 Well-Known Member

    Messages:
    1,231
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    150
    Digital Goods:
    2
    #3
    that's good job, thank
     
    temp2, Oct 7, 2007 IP