Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. seperating items

seperating items

Scheduled Pinned Locked Moved C / C++ / MFC
csharpphpdata-structuresquestion
5 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    Sam 2006
    wrote on last edited by
    #1

    hello, i have a cstring like this:

    item1,item2,item3,item4,etc

    is their a way to get each item seperated by a comma into an array (or a for loop)? i want to add each item to a listbox. (something like php's explode() function: http://us2.php.net/explode) thanks in advance

    D P T 3 Replies Last reply
    0
    • S Sam 2006

      hello, i have a cstring like this:

      item1,item2,item3,item4,etc

      is their a way to get each item seperated by a comma into an array (or a for loop)? i want to add each item to a listbox. (something like php's explode() function: http://us2.php.net/explode) thanks in advance

      D Offline
      D Offline
      David Crow
      wrote on last edited by
      #2

      Are you looking for AfxExtractSubString()?


      "The largest fire starts but with the smallest spark." - David Crow

      S 1 Reply Last reply
      0
      • S Sam 2006

        hello, i have a cstring like this:

        item1,item2,item3,item4,etc

        is their a way to get each item seperated by a comma into an array (or a for loop)? i want to add each item to a listbox. (something like php's explode() function: http://us2.php.net/explode) thanks in advance

        P Offline
        P Offline
        Peter Weyzen
        wrote on last edited by
        #3

        use Tokenize() ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Peter Weyzen Staff Engineer [SoonR Inc.](http://www.soonr.com)

        1 Reply Last reply
        0
        • D David Crow

          Are you looking for AfxExtractSubString()?


          "The largest fire starts but with the smallest spark." - David Crow

          S Offline
          S Offline
          Sam 2006
          wrote on last edited by
          #4

          Used that. Thanks for the tip.

          1 Reply Last reply
          0
          • S Sam 2006

            hello, i have a cstring like this:

            item1,item2,item3,item4,etc

            is their a way to get each item seperated by a comma into an array (or a for loop)? i want to add each item to a listbox. (something like php's explode() function: http://us2.php.net/explode) thanks in advance

            T Offline
            T Offline
            ThatsAlok
            wrote on last edited by
            #5

            Sam Kline wrote:

            is their a way to get each item seperated by a comma into an array (or a for loop)? i want to add each item to a listbox.

            see example quoted in Help of CStringT::Tokenize in MSDN!

            "Opinions are neither right nor wrong. I cannot change your opinion. I can, however, change what influences your opinion." - David Crow

            cheers, Alok Gupta VC Forum Q&A :- I/ IV

            1 Reply Last reply
            0
            Reply
            • Reply as topic
            Log in to reply
            • Oldest to Newest
            • Newest to Oldest
            • Most Votes


            • Login

            • Don't have an account? Register

            • Login or register to search.
            • First post
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • World
            • Users
            • Groups