Consider the below code statement:
Dim strURLAddress As String
strURLAddress = "http://www.google.co.in/search?sourceid=chrome&ie=UTF-8&q=CodeProject"
Let's say the job is to fetch the query string value for "
ie
" in the above URL Address.
The plain and simple way is to use indexes, substring and get dirty with the
string
functions.
Here's a much better alternative:
HttpUtility.ParseQueryString(strURLAddress)("ie")
ParseQueryString
is a method of
HttpUtility
class under
System.Web
namespace.
It simply parses a query
string
into a
NameValueCollection
using UTF8 encoding.