From debugger in my string of arrays I am getting this:
"/mercedes-benz/190-class/1993/" class="canonicalLink" data-qstring="?sub=sedan">1993
I wish to split text after each '/'
and get it in string[]
, here is my effort:
Queue<string> see = new Queue<string>(); //char[] a = {'
'};
List<car_facts> car_fact_list = new List<car_facts>();
string[] car_detail;
foreach (string s in car)
{
MatchCollection match = Regex.Matches(s, @"<a href=(.+?)</a>",
RegexOptions.IgnoreCase);
// Here we check the Match instance.
foreach(Match mm in match)
{
// Finally, we get the Group value and display it.
string key = mm.Groups[1].Value;
//key.TrimStart('"');
//key.Trim('"');
key.Trim();
// @HERE: I tried with string.Split as well and tried many combinations of separators
car_detail = Regex.Split(key, "//");
see.Enqueue(key);
}
}
In car_detail[0]
I get this "$[link]">$[title]
from this string:
"/mercedes-benz/190-class/1993/" class="canonicalLink" data-qstring="?sub=sedan">1993
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…