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#
  4. String Extraction

String Extraction

Scheduled Pinned Locked Moved C#
htmlcomquestion
6 Posts 5 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.
  • N Offline
    N Offline
    NaveenHS
    wrote on last edited by
    #1

    Hello All, I am scraping some text from a html page and writing to a text file. after every line extraction i am adding the text to list & in the end i am writing to a text file. in one pass i am getting text as Email: ptadeep.g@someemail.com Membership Type: in this line i want only the email id , Please is there any method to remove the words Email & Membership Type from the string and then add only email id to list ??

    L L R A 4 Replies Last reply
    0
    • N NaveenHS

      Hello All, I am scraping some text from a html page and writing to a text file. after every line extraction i am adding the text to list & in the end i am writing to a text file. in one pass i am getting text as Email: ptadeep.g@someemail.com Membership Type: in this line i want only the email id , Please is there any method to remove the words Email & Membership Type from the string and then add only email id to list ??

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      String.Split()[^] should do the job.

      It's time for a new signature.

      N 1 Reply Last reply
      0
      • N NaveenHS

        Hello All, I am scraping some text from a html page and writing to a text file. after every line extraction i am adding the text to list & in the end i am writing to a text file. in one pass i am getting text as Email: ptadeep.g@someemail.com Membership Type: in this line i want only the email id , Please is there any method to remove the words Email & Membership Type from the string and then add only email id to list ??

        L Offline
        L Offline
        Luc Pattyn
        wrote on last edited by
        #3

        if you have problems dealing with strings, the natural approach is to read up on the String class. It has a lot of methods, and whatever your problem is, there will be one or more solutions. :)

        Luc Pattyn [Forum Guidelines] [Why QA sucks] [My Articles] Nil Volentibus Arduum

        Please use <PRE> tags for code snippets, they preserve indentation, and improve readability.

        1 Reply Last reply
        0
        • L Lost User

          String.Split()[^] should do the job.

          It's time for a new signature.

          N Offline
          N Offline
          NaveenHS
          wrote on last edited by
          #4

          Thanks Richard for the response. I tried with IndexOf ,LastIndexOf & str.Substring methods and got the output.

          1 Reply Last reply
          0
          • N NaveenHS

            Hello All, I am scraping some text from a html page and writing to a text file. after every line extraction i am adding the text to list & in the end i am writing to a text file. in one pass i am getting text as Email: ptadeep.g@someemail.com Membership Type: in this line i want only the email id , Please is there any method to remove the words Email & Membership Type from the string and then add only email id to list ??

            R Offline
            R Offline
            Ravi Bhavnani
            wrote on last edited by
            #5

            Regex is your friend. /ravi

            My new year resolution: 2048 x 1536 Home | Articles | My .NET bits | Freeware ravib(at)ravib(dot)com

            1 Reply Last reply
            0
            • N NaveenHS

              Hello All, I am scraping some text from a html page and writing to a text file. after every line extraction i am adding the text to list & in the end i am writing to a text file. in one pass i am getting text as Email: ptadeep.g@someemail.com Membership Type: in this line i want only the email id , Please is there any method to remove the words Email & Membership Type from the string and then add only email id to list ??

              A Offline
              A Offline
              AspDotNetDev
              wrote on last edited by
              #6

              Substring, Regex, IndexOf.

              [Forum Guidelines]

              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