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 3 of 3
  1. #1
    New to the CF scene
    Join Date
    Jun 2004
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Question How do I remove a character from a string

    Hi all,
    I am quite new to programming in javaScript and I am trying to find the code to remove a character/s from a string/s. As an example, if I initialise a variable called 'aString' and utilise 'window.prompt' to input 'Summer' or 'Have a nice day', what would be the code between 'window.prompt' and the last line 'document.write' to get the result result 'Smmr' or 'ae a ie a'?

  • #2
    Senior Coder
    Join Date
    Aug 2002
    Location
    Kansas City, Kansas
    Posts
    1,518
    Thanks
    0
    Thanked 2 Times in 2 Posts
    To accomplish this, you will need to use regular expressions. I'm sure that you can get some help as soon as this thread is moved to the javascript section and not the post a javascript section... I'll give you the benefit of the doubt and guess that you were reading in this forum and forgot which you were in when posting. In the future, make sure that you're in the right forum for your topic.

  • #3
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,075
    Thanks
    0
    Thanked 256 Times in 252 Posts
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________


  •  

    Posting Permissions

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