Connecting Tech Pros Worldwide Forums | Help | Site Map

how to separate string within the specified tag in c#

Newbie
 
Join Date: Apr 2009
Posts: 9
#1: Apr 8 '09
i want to separate string within the specified tag.
eg.,
<strong>some string here</strong>


result should be:"some string here"

pl help me.

Expert
 
Join Date: Jun 2008
Location: Pretoria, South Africa
Posts: 410
#2: Apr 8 '09

re: how to separate string within the specified tag in c#


Hi

What have you tried?
I suggest you read up on Regex as well as substrings/general string manipulation. Decide which approach you are more comfortable with and then attempt to create a solution.

If you get stuck with a specific piece of code or point in your algorithm, post it and we'll help you find a solution.
Newbie
 
Join Date: Apr 2009
Posts: 9
#3: Apr 8 '09

re: how to separate string within the specified tag in c#


Quote:

Originally Posted by cloud255 View Post

Hi

What have you tried?
I suggest you read up on Regex as well as substrings/general string manipulation. Decide which approach you are more comfortable with and then attempt to create a solution.

If you get stuck with a specific piece of code or point in your algorithm, post it and we'll help you find a solution.

I have to strongly take out string between some tags like <strong>, <span> and i have to store them in a separate array.please do me tat favor for me.
Newbie
 
Join Date: Apr 2009
Posts: 9
#4: Apr 8 '09

re: how to separate string within the specified tag in c#


How to take out string within a tag in c#?
Please help me out directly.
eg:<span>something...</span>

o/p:
something....
Expert
 
Join Date: Jun 2008
Location: Pretoria, South Africa
Posts: 410
#5: Apr 8 '09

re: how to separate string within the specified tag in c#


I have given you a starting point and mentioned 2 possible approaches to solving this problem. Investigate them and try one, I'll gladly help you towards a solution but I'm not going to write the solution for you.

Try to solve the problem using string manipulation check this MSDN entry, it contains explanations on ALL the functions which you will need. Try to create a solution using these functions, if you get stuck post the code, explain where you got stuck and I will help you further.

Start by creating an algorithm which will find the tags within a body of text, once we have that aspect we can look at extracting the text between tags.
Reply

Tags
asp.net, csharp, regex, string