SitePoint Sponsor

User Tag List

Results 1 to 2 of 2

Hybrid View

  1. #1
    SitePoint Enthusiast
    Join Date
    Sep 2000
    Location
    UK
    Posts
    44
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Removing the commas

    Hi all,

    How do I remove the resulting comma from the output in this sort snippet?

    <script type="text/javascript">
    var arr = new Array()
    arr[1] = "C"
    arr[2] = "B"
    arr[3] = "A"
    document.write(arr.sort())
    </script>

    Gives me: A, B, C
    Needed: A B C

    Thanks (real clueless with jscript!)
    SamX

  2. #2
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    document.write(arr.sort().join(" "))


Bookmarks

Posting Permissions

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