Pergunta de entrevista da empresa The Proven Method

Given a URL string with a collection of parameters, how can you parse through the string to determine the URL and parameter names/values?

Resposta da entrevista

Sigiloso

16 de mar. de 2011

Regular expressions should determine if the URL is valid. Once that is determined, you can search for a '?' character to determine the beginning of the URL parameters, and then parse through each searching for '&', while splitting name/value via '='.