Sure, but it's not quite the same thing.
For example, that code would work if the actual URL was "menubar.asp?name=framitz" whereas the original *INSISTS* that the string END with 'menubar.asp".
So that code is more flexible, but it is not an exact replacement.
An optimist sees the glass as half full.
A pessimist sees the glass as half empty.
A realist drinks it no matter how much there is.