New function in URI class.

I  have created this simple function for the URI class, It grabs the last segment in the URI.
This is my first ever submission, so please if I am doing anything wrong , my apologies in advance.