Can't you just append "/.."?
In reply to Re: removing the last word by ambrus in thread removing the last word by s_gaurav1091