extract query string from a URL string

后端 未结 8 1509
抹茶落季
抹茶落季 2021-01-04 04:10

I am reading from history, and I want that when i come across a google query, I can extract the query string. I am not using request or httputility since i am simply parsing

相关标签:
8条回答
  • 2021-01-04 04:51

    Use the tools available:

    String UrlStr = "http://www.google.com.mt/search?client=firefox-a&rls=org.mozilla%3Aen-US%3Aofficial&channel=s&hl=mt&source=hp&biw=986&bih=663&q=hotmail&meta=&btnG=Fittex+bil-Google";
    
    NameValueCollection Items = HttpUtility.ParseQueryString(UrlStr);
    
    String QValue = Items["q"];
    
    0 讨论(0)
  • 2021-01-04 04:51

    And that's why you should use Uri and HttpUtility.ParseQueryString.

    0 讨论(0)
提交回复
热议问题