Jump to content

Python du vex string manipulation


davidyannick

Recommended Posts

Bonjour David,

A quick Google Search gives this as the first result → find

This gives the first occurrence instead of the last one. To find the last one, I would invert the string temporarily.

Although it looks like you are trying to split a path to get the name of the file (or the last folder)
There is the splitpath function that does just that.

Hope that helps !

Link to comment
Share on other sites

17 hours ago, Alain2131 said:

Bonjour David,

A quick Google Search gives this as the first result → find

This gives the first occurrence instead of the last one. To find the last one, I would invert the string temporarily.

Although it looks like you are trying to split a path to get the name of the file (or the last folder)
There is the splitpath function that does just that.

Hope that helps !

thanks it helps me a lot,  I'm a complet noob in Python sorry

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...