Results 1 to 4 of 4

Thread: [RESOLVED] Javascript array.join ignoring specified delimiter

Threaded View

  1. #1

    Thread Starter
    Fanatic Member aconybeare's Avatar
    Join Date
    Oct 2001
    Location
    UK
    Posts
    772

    Resolved [RESOLVED] Javascript array.join ignoring specified delimiter

    Hi,
    Can anyone see why the below join isn't working? It insists on joining the string with a comma ",". It's not the "~" as I've tried changing the delimiter to dot "." and "|" with no effect and it's not the splice as I've commented it out and that didn't make any difference either

    Code:
    <html>
    <body>
    
    <script type="text/javascript">
    var item=1;
    var val="jani~hege~stale";
    val=val.split("~");
    if(val.length>=item){
      val.splice(item,1);
      val.join("~");
    }
    alert(val);
    
    </script>
    
    </body>
    </html>
    Any help will be greatly appreciated

    Cheers Al
    Last edited by aconybeare; Nov 12th, 2006 at 04:07 AM. Reason: improve title

Posting Permissions

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



Click Here to Expand Forum to Full Width