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 8005491
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T17:14:44+00:00 2026-06-04T17:14:44+00:00

I have a pretty long string. Before I databind the string, I want to

  • 0

I have a pretty long string. Before I databind the string, I want to be able to modify the string by inserting some more text. For example, I have a string <a href="/a/info/a.html"><img src="/userimage/imgs.jpg"/></a> I need to insert http://m.mydom.com right before the /a and right before /userimage. Note, this will always be the same so it is safe to say that the string I want to add to will be consistent. I would like to do this either with lamda or just c#. Thanks for any help.

  • 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-04T17:14:46+00:00Added an answer on June 4, 2026 at 5:14 pm

    If you need to do this for all relative paths on your page, using C# to accomplish this is actually not the best tool for this.

    HTML comes with an element called base (see spec information) that is used to specify a document’s base URI explicitly. If you changed your HTML to something like the following:

    <head>
        <base href="http://m.mydom.com">
    </head>
    <body>
        <a href="/a/info/a.html"><img src="/userimage/imgs.jpg"/></a>
    </body>
    

    Both the image and the anchor will point to the correct base. Don’t believe me? Check out this jsFiddle demonstating the amazingness of base.

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

Sidebar

Related Questions

I have a text file that is pretty long. Any easy way to undo
I have a list of user identifiers which are pretty long. The identifiers may
I have looped data from mysql, and it's a pretty long list. What's the
I have a variable x to which I want to assign a very long
I have a long string, consisting of multiple sentences, of various length, divided by
I've been writing some pretty long SQL queries in notepad and then pasting them
I have an html code stored in a string. Now I want to extract
Long time lurker, first time poster. I have found some good answers on here
I have a pretty big data entry form which has many text fields ,
I have this query which is pretty long, but adding a where clause to

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.