Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Mar 2003
    Posts
    7
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Angry Remove characters

    Hi!
    How do I remove white spaces, special characters, change to upper case in one expression?

    e.g. j a(/"Va"scr ipt. 12 &
    should return - JAVASCRIPT12
    THANKS

  • #2
    Regular Coder
    Join Date
    Feb 2003
    Posts
    638
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This seems to work:

    var s = "j a(/\"Va\"scr ipt. 12 &";
    alert(s.replace(/[^0-9a-z]/gi, "").toUpperCase());
    hmm... ?


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •