On Thu, Sep 4, 2008 at 3:25 PM, Mathieu Prevot <mathieu.prevot @gmail.comwrote :
a.rstrip('/') does the job.
bye,
Francesco
Hi,
>
for scripts that take arguments, I would like to remove the trailing
slash if it's present.
>
Is there something else than:
>
a='/usr/local/lib/'
if a[-1] == '/':
a = list(a)
a.pop()
''.join(a)
>
Thanks,
Mathieu
>
for scripts that take arguments, I would like to remove the trailing
slash if it's present.
>
Is there something else than:
>
a='/usr/local/lib/'
if a[-1] == '/':
a = list(a)
a.pop()
''.join(a)
>
Thanks,
Mathieu
bye,
Francesco
Comment