i want to find category from the link. I am breaking the link into array using Regex like this.
string input = link; string pattern = "/"; // Split on hyphens string[] substrings = Regex.Split(input, pattern); foreach (string match in substrings) { Console.WriteLine("'{0}'", match); } My links are:
http://www.example.com/lifestyle/food/a93ypt9-1227277841603?from=public_atom http://www.example.com/sports/scoccer/accept9-1227277841603?from=public_atom Whereas categories of the above links
lifestyle sports I am splitting the link on hyphens and finding out my category but is there any better way to accomplish my task?