I was wondering if there is a nice pattern or better yet a specific function which applies a function until there is no longer a change in it's result.
url = "http://www.zzz.com/yyy/lt%255B1%255D.jpg"
unescaped = unescape(url)
while unescaped != url do
url = unescaped
unescaped = unescape(unescaped)
end
Although the code above is basically ruby it is readable enough as psudocode I think. The first setting of unescaped is to http://www.zzz.com/yyy/lt%5B1%5D.jpg, the loop is then invoked as there has been a change and as such unescaped becomes http://www.zzz.com/yyy/lt[1].jpg, the loop is called again as there has yet again been a change but this time there us nothing to unescape and so url and unescaped become the same breaking the while loop.
There is nothing wrong with this code per-say I mealy wonder if there is a more sussinct way of representing it, either in psudocode form or, for my specific case, in ruby.
Much appreciate the help as always!