I've got users to enter letters into a string like this
A/B/C/D
I want to preform a check that sees if the last one or first one is a /
for example
/A/B/C or
A/B/C/ or even
/A/B/C/D/
It should just be
A/B/C
I would then want to remove the /
how can i do this?