myString=
I want to extract the text between and
and also the text between
in two different arrays.
How to do this, please help me. if anyone have code or any helpfull link please reply back.
Thanks
Know the answer? Post it. Somebody with the same question will find it here.
Answer a question in the forums and earn +20 SHARP for every answer.
See unanswered questions
DevSocialUpcoming · 3rd editionAI Agents ConferenceDec 1–3, 2026Live onlineFree to attend5days leftRegister
Andy Tirtajaya6 reputationPosted Aug 8, 2008, 12:28 AM EDT
string tagToBeSplit = "
this is the string to be written
";Response.Write(tagToBeSplit.Split(new string[2]{ "
","
" }, StringSplitOptions.RemoveEmptyEntries)[0]);Dimitrije Misic5 reputationPosted Aug 8, 2008, 12:54 AM EDT
ArrayList links = new ArrayList();
int e = 0; int linkStartPos = 0; int linkEndPos = 0; int s = 0;
while ((linkStartPos >= 0) & (linkEndPos >= 0))
{
linkStartPos = myString.IndexOf("", s, StringComparison.CurrentCultureIgnoreCase);
if (linkStartPos >= 0) linkStartPos = linkStartPos + 6;
linkEndPos = myString.IndexOf("", e, StringComparison.CurrentCultureIgnoreCase);
if ((linkStartPos >= 0) & (linkEndPos >= 0)) links.Add(myString.Substring(linkStartPos, linkEndPos - linkStartPos));
s = linkStartPos; e = linkEndPos + 7;
}
the title part is pretty much the same.