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. CString.Find("@",0) problem

CString.Find("@",0) problem

Scheduled Pinned Locked Moved C / C++ / MFC
databasehelpquestion
3 Posts 3 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.
  • C Offline
    C Offline
    carrie
    wrote on last edited by
    #1

    Hi, Seems like a really stupid one but I'm trying to read email addresses out of around about 100 txt files that have been exported from a database. My plan was to CString.Find() the @ symbol, because only the email addresses have @ symbols in the file, then CString.Find() the space behind it to get the end of the address, then to work backwards and find the first space in front of the @. My problem is though that if I do bleh.Find("@",0); I always get a return of -1, that there isn't one there. Does anyone know what I've done wrong/need to do to get this fixed? Thanks

    C V 2 Replies Last reply
    0
    • C carrie

      Hi, Seems like a really stupid one but I'm trying to read email addresses out of around about 100 txt files that have been exported from a database. My plan was to CString.Find() the @ symbol, because only the email addresses have @ symbols in the file, then CString.Find() the space behind it to get the end of the address, then to work backwards and find the first space in front of the @. My problem is though that if I do bleh.Find("@",0); I always get a return of -1, that there isn't one there. Does anyone know what I've done wrong/need to do to get this fixed? Thanks

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Have you traced through to make *sure* the address is there ? What does the code look like ? Christian No offense, but I don't really want to encourage the creation of another VB developer. - Larry Antram 22 Oct 2002
      C# will attract all comers, where VB is for IT Journalists and managers - Michael P Butler 05-12-2002
      Again, you can screw up a C/C++ program just as easily as a VB program. OK, maybe not as easily, but it's certainly doable. - Jamie Nordmeyer - 15-Nov-2002

      1 Reply Last reply
      0
      • C carrie

        Hi, Seems like a really stupid one but I'm trying to read email addresses out of around about 100 txt files that have been exported from a database. My plan was to CString.Find() the @ symbol, because only the email addresses have @ symbols in the file, then CString.Find() the space behind it to get the end of the address, then to work backwards and find the first space in front of the @. My problem is though that if I do bleh.Find("@",0); I always get a return of -1, that there isn't one there. Does anyone know what I've done wrong/need to do to get this fixed? Thanks

        V Offline
        V Offline
        valikac
        wrote on last edited by
        #3

        Consider a character if you want to search for one element and a string otherwise. Find('@'); // 0 is default Find("string"); Kuphryn

        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