Results 1 to 3 of 3

Thread: Displaying specific Text from string

  1. #1

    Thread Starter
    New Member
    Join Date
    Mar 2015
    Posts
    2

    Displaying specific Text from string

    Currently my code is pulling and displaying the html code from a website. To display it I converted it into a string "thepage" and just displaying all of it. I would like it to basically display only a specific piece of text from the string.

    Example, the string may display "<br>==============<br><br>gmail-abuse@google.com<br><br>"

    I would like it to only display, "gmail-abuse@google.com"

    Any help on how to trim off the beginning and end of that string?

  2. #2
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    9,677

    Re: Displaying specific Text from string

    Use String.Replace:
    Code:
    Dim html As String = "<br>==============<br><br>gmail-abuse@google.com<br><br>"
    'Replace any <br> and = with an empty string
    Dim email As String = html.Replace("<br>", String.Empty).Replace("=", String.Empty)

  3. #3
    Fanatic Member Toph's Avatar
    Join Date
    Oct 2014
    Posts
    655

    Re: Displaying specific Text from string

    dday9's example is a good way to go about doing this. If there's more difficult obstacles, you could use Regex to extract the email.

Posting Permissions

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



Click Here to Expand Forum to Full Width