Thanks for the code idea. I like what you wrote.
If there's no '?' in the URL, then you can return false right away,
right?
Indeed!
public boolean isParamInUrl(String url, String paramName)
{
~ return url.contains('?' + paramName + '=')
~ || url.contains('&' + paramName + '=');
}
This looks simpler, easier to read, and less error-prone. I would
venture a guess that it runs faster than your implementation, too.
Yes, I think I like it. I think I have to save a
URLEncoder.encode(paramName) first and then use that in the to
url.contains calls just to be safe. Your code is much easier to
understand and no doubt runs faster.
Thanks,
David
---------------------------------------------------------------------
To start a new topic, e-mail: [email protected]
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]