Hi, I just want to know if i can remove a part of a string
Exemple : in Textbox1 i have "C:\Users\Someone\Desktop\test.exe" and i want delete the string until the "\" so in the textbox i get "C:\Users\Someone\Desktop\"
Thanks if you reply me and sorry for the bad english, its not my main language ...

Recommended Answers

All 4 Replies

You haven't mentioned what language you intend to be using for this but the answer is yes, it's possible. Depending on what functions you have available in your chosen language you need to determine the location of the last \ and then create a substring from position 0 to the that last '\'.
A lot of languages have methods that will provide you with the file name, the thing.exe part of a path as well, which would allow to do a replace, swapping the file name with an empty string. Or alternatively return the path with the file name removed automatically.
If we knew what language you were using we could provide actual examples.

Ok thanks you all for the help i found what i search :) !

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, learning, and sharing knowledge.