Say I have a string: var str="localhost:20012/prj/duck/duck/woohoo"
.
As you might have noticed there is 2 /duck
at the above string. FYI: There could be more.
What I basically Want is to remove all and just leave want so its gonna look like: localhost:20012/prj/duck/woohoo