how to extrack string from a sentence?
-
I have a string stored in a variable, say myString= <RssFeeds><link>http://www.codeguru.com/icom\_includes/feeds/codeguru/rss-all.xml</link> <title>CodeGuru.com</title> <description>something</description></RssFeeds> <RssFeeds> <link>http://lifehacker.com/index.xml</link> <title>Lifehacker</title> <description>something</description></RssFeeds> I want to extract the text between <link> and </link> and also the text between <title> and </title> in two different arrays. How to do this, please help me. if anyone have code or any helpfull link please reply back. Thanks
-
I have a string stored in a variable, say myString= <RssFeeds><link>http://www.codeguru.com/icom\_includes/feeds/codeguru/rss-all.xml</link> <title>CodeGuru.com</title> <description>something</description></RssFeeds> <RssFeeds> <link>http://lifehacker.com/index.xml</link> <title>Lifehacker</title> <description>something</description></RssFeeds> I want to extract the text between <link> and </link> and also the text between <title> and </title> in two different arrays. How to do this, please help me. if anyone have code or any helpfull link please reply back. Thanks
You could alway use regular expressions.
"The clue train passed his station without stopping." - John Simmons / outlaw programmer "Real programmers just throw a bunch of 1s and 0s at the computer to see what sticks" - Pete O'Hanlon
-
I have a string stored in a variable, say myString= <RssFeeds><link>http://www.codeguru.com/icom\_includes/feeds/codeguru/rss-all.xml</link> <title>CodeGuru.com</title> <description>something</description></RssFeeds> <RssFeeds> <link>http://lifehacker.com/index.xml</link> <title>Lifehacker</title> <description>something</description></RssFeeds> I want to extract the text between <link> and </link> and also the text between <title> and </title> in two different arrays. How to do this, please help me. if anyone have code or any helpfull link please reply back. Thanks
Try using this way string myString = "http://www.codeguru.com/icom\_includes/feeds/codeguru/rss-all.xml" + "CodeGuru.comsomething" + "http://lifehacker.com/index.xmlLifehackersomething"; string[] test = new string[15]; myString = myString.Replace("", "#"); myString = myString.Replace("", "#"); test = myString.Split(Convert.ToChar("#"));
-
Try using this way string myString = "http://www.codeguru.com/icom\_includes/feeds/codeguru/rss-all.xml" + "CodeGuru.comsomething" + "http://lifehacker.com/index.xmlLifehackersomething"; string[] test = new string[15]; myString = myString.Replace("", "#"); myString = myString.Replace("", "#"); test = myString.Split(Convert.ToChar("#"));
-
I want to extract substring and store it in an array from to , it repeats two times in my string. How to extract it?
-
I have a string stored in a variable, say myString= <RssFeeds><link>http://www.codeguru.com/icom\_includes/feeds/codeguru/rss-all.xml</link> <title>CodeGuru.com</title> <description>something</description></RssFeeds> <RssFeeds> <link>http://lifehacker.com/index.xml</link> <title>Lifehacker</title> <description>something</description></RssFeeds> I want to extract the text between <link> and </link> and also the text between <title> and </title> in two different arrays. How to do this, please help me. if anyone have code or any helpfull link please reply back. Thanks
Dirty but seems to work.
string sFull = "this the is test for the true";
string sToSearch = "the";
int iFirst = sFull.IndexOf(sToSearch);
int iSecond = sFull.IndexOf(sToSearch, iFirst + sToSearch.Length);
string sText = sFull.Substring(iFirst + sToSearch.Length, iSecond - iFirst -sToSearch.Length); -
I have a string stored in a variable, say myString= <RssFeeds><link>http://www.codeguru.com/icom\_includes/feeds/codeguru/rss-all.xml</link> <title>CodeGuru.com</title> <description>something</description></RssFeeds> <RssFeeds> <link>http://lifehacker.com/index.xml</link> <title>Lifehacker</title> <description>something</description></RssFeeds> I want to extract the text between <link> and </link> and also the text between <title> and </title> in two different arrays. How to do this, please help me. if anyone have code or any helpfull link please reply back. Thanks
-
I have a string stored in a variable, say myString= <RssFeeds><link>http://www.codeguru.com/icom\_includes/feeds/codeguru/rss-all.xml</link> <title>CodeGuru.com</title> <description>something</description></RssFeeds> <RssFeeds> <link>http://lifehacker.com/index.xml</link> <title>Lifehacker</title> <description>something</description></RssFeeds> I want to extract the text between <link> and </link> and also the text between <title> and </title> in two different arrays. How to do this, please help me. if anyone have code or any helpfull link please reply back. Thanks
Yeah, XmlDocument.