Jump to content

ReneIsOnline

Members
  • Posts

    2
  • Joined

  • Last visited

Everything posted by ReneIsOnline

  1. Hello Iyeru42, I tried your solution in several variations, but now I end up with a syntax error...
  2. I'm learning myself JavaScript, using a book from Wrox Press, I'm new to forums, so forgive me any mistakes :)I'm facing a problem with regular expressions, the code below is an example from the book and splits every fruit nicely into an array. Now I want only the prices into an array, but somehow I everytime end up with array index 0 totally empty and the prices in index 1 to 4. I tried many variations, but as soon as you remove the letters it already ends up empty array index 0.....One thing to add: it only goes wrong in Firefox 2, in Internet Explorer 7 everything is correct...What am I doing wrong? And how to get rid of the empty index 0? <script language="JavaScript" type="text/JavaScript">var myListString = "apple, 0.99, banana, 0.50, peach, 0.25, orange, 0.75";var theRegExp = /[^a-z]+/i;var myFruitArray = myListString.split(theRegExp);document.write(myFruitArray.join("<br>"));</script>
×
×
  • Create New...