SitePoint Sponsor

User Tag List

Results 1 to 2 of 2
  1. #1
    SitePoint Member
    Join Date
    Sep 2004
    Location
    singapore
    Posts
    15
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    How to seperate a String with JavaScript?

    example I have a String that look like:
    this is one|this is two|this is three|this is four|this is five

    And I want to seperate the String using JavaScript like:
    this is one
    this is two
    this is three
    this is four
    this is five

    How should I do it?

  2. #2
    SitePoint Wizard stereofrog's Avatar
    Join Date
    Apr 2004
    Location
    germany
    Posts
    4,324
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    alert("a|b|c".split("|"))


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
  •