Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7799899
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T00:27:24+00:00 2026-06-02T00:27:24+00:00

I have a basic anchor node as a string and would like to get

  • 0

I have a basic anchor node as a string and would like to get the URL and the text from it. For example:

<a href="http://MyAwesomeWebsite.com/">Go to MyAwesomeWebsite</a>

I want two strings, one with:

http://MyAwesomeWebsite.com/

and the other with

MyAwesomeWebsite

How do I code this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-02T00:27:27+00:00Added an answer on June 2, 2026 at 12:27 am

    you can use regular expressions to extract the text that you want as next:

        Imports System.Text.RegularExpressions
        Sub Main()
        Dim anchor As String
        anchor = "<a href=""http://MyAwesomeWebsite.com/"">Go to MyAwesomeWebsite</a>"
    
        Dim href As String = Regex.Match(anchor, "\""[a-z,A-Z,0-9,:,/,.]+\""").Value
        Console.WriteLine(href.Substring(1, href.Length - 2))
    
        Dim content As String = Regex.Match(anchor, "\>[a-z,A-Z,0-9,:,/,., ]+\<").Value
        Console.WriteLine(content.Substring(1, content.Length - 2))
        Console.ReadKey()
        End Sub
    

    Also you can use the methods provided by String like IndexOf and Substring.
    But if you are thinking on parse a lot of those thinks I suggest you use a library like HtmlAgilePack.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an anchor tag: <a href="file.pdf">Download Me</a> I would like for the user
I have a basic string with holds a html table. The table looks like
I have basic CSS experienced so I would like to know how can I
Sorry about the wording for my question title. I have a basic HTML anchor
I have basic hello word example of Prime Faces. I have created dynamic web
I have a basic class that derived subclasses inherit from, it carries the basic
I have a basic PHP question, take the code below for example, let's say
I'm trying to convert text containing URL's into HTML anchors using Visual Basic in
I have basic idea about running PHP in different configurations like mod_php, cgi, FastCGI,
I have basic code that looks like this: while(inputfileStream.good()) { for(int i = 0;i<levels;i++)

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.