I have a query string that I need to split into 2 separate int and I'm having a hard time getting it to work and a hard time understanding other examples. Basically I want to split the date part of a url for example - www.website.com?2019&9. Here is what I have been trying to get to work. I know there is definitely a more elegant way to do this but I'm new to using query strings.
string QueryString = Request.QueryString.ToString();
int [] QueryInt = new int[2];
int k = 0;
string[] QuerySplit = QueryString.Split('&');
foreach (var item in QuerySplit)
{
int.TryParse(QueryString, out QueryInt[k]);
k++;
}