System.ArgumentOutOfRangeException: 'Index and count must refer to a location within the string.'
var matches = Regex.Matches(Intermeddiate.ToString(), "<title>(.*?)</title>"); foreach (var item in matches) { if (TitlestartPresnt && TitleendPresent) { string titleImpure = item.ToString(); string removedfront = titleImpure.Remove(0, 7); string removedback = removedfront.Remove(removedfront.IndexOf(Titleend), removedfront.IndexOf(Titleend)+7); Title = removedback; Console.WriteLine(Title); // int Titlestartindex = item.IndexOf(Titlestart); //int Titleemdindex = Intermeddiate.IndexOf(Titleend); // if (Titlestartindex+50 > Titleemdindex -50) // { // int titlestart = Intermeddiate.IndexOf(Titlestart) + Titlestart.Length; // int titleend = Intermeddiate.IndexOf(Titleend) - 10; //make so works properly // string PureTexttitle = Intermeddiate.Substring(titlestart, titleend - titlestart); // Console.WriteLine("Title-" + PureTexttitle); // TitlesCList.Add(PureTexttitle); // } // else // { // Console.WriteLine("No title for this article"); // } } }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)