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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 16, 20262026-06-16T02:50:02+00:00 2026-06-16T02:50:02+00:00

Possible Duplicate: How to use HTML Agility pack I have html code below: <div><span

  • 0

Possible Duplicate:
How to use HTML Agility pack

I have html code below:

<div><span class="help">This is text.</span>Hello, this is text.</div>
<div>I have a question.<span class="help">Hi</span></div>

Now, I want to remove text which is between <span class="help"></span> using C#. So, I want to leave only

<div>Hello, this is text.</div>
<div>I have a question.</div>

Anyone has any idea?

  • 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-16T02:50:08+00:00Added an answer on June 16, 2026 at 2:50 am

    You should use Html Agility Pack to work with html.

    string text = @"<div><span class=""help"">This is text.</span>Hello, this is text.      </div>
                    <div>I have a question.<span class=""help"">Hi</span></div>";
    HtmlDocument doc = new HtmlDocument();
    doc.LoadHtml(text);
    var nodes = doc.DocumentNode.SelectNodes("//span[@class='help']");
    foreach( HtmlNode node in nodes)
    {
       node.Remove();
    } 
    String result = doc.DocumentNode.InnerHtml;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Possible Duplicate: How to use HTML Agility pack I haven't yet downloaded Html Agility
Possible Duplicate: Get selected element's outer HTML I have this code : <html> <head></head>
Possible Duplicate: How to use HTML param in Actionscript 2 I have this flash
Possible Duplicate: nearest ancestor node in jQuery html: <div class=post> <h2><a href=# title=>Pellentesque</a></h2> <p><a
Possible Duplicate: Use jQuery to change an HTML tag? I have searched around for
Possible Duplicate: How to use CSS hover inside html-tag? <body> <div id=he> <div id=header>
Possible Duplicate: special characters in id of html tags I have a DIV with
Possible Duplicate: Why not use tables for layout in HTML? I have read a
Possible Duplicate: How can I use C++ code to interact with PHP? I have
Possible Duplicate: Use of option helper in Play Framework 2.0 templates Normal html code:

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.