On Tue, Aug 25, 2009 at 3:55 PM, <[email protected]> wrote:

> Hello,
> I want to strip the first '/' from the following:
>
> '/path/to/file'
>
> How can I do this?
>
> Dave
> _______________________________________________
> Tutor maillist  -  [email protected]
> http://mail.python.org/mailman/listinfo/tutor
>

there are many ways to do this, heres a few:

x = "/path/to/file"

print x.partition("/")[-1]
print x[1:]
print "/".join(x.split("/")[1:])
_______________________________________________
Tutor maillist  -  [email protected]
http://mail.python.org/mailman/listinfo/tutor

Reply via email to