dimanche 22 février 2015

Visual basic string manipulation, detect backslashes

Something very simple I need for a program I am working on in VB:


I have some paths in the sense of



F:\2014-2015\images\nature\34.jpg
C:\img\E_games\gw017.jpg
E:\Projects\projectsImages\people\1.jpg


The last part of these paths is always a fixed, definitive part I need. From these strings I need:



\nature\34.jpg
\E_games\gw017.jpg
\people\1.jpg


So always a fixed folder and fixed image name. How do I trim



F:\2014-2015\images\nature\34.jpg


To



\nature\34.jpg


While everything before the second part is variable? Can I somehow detect the two backslashes and trim everything in front of those?


Substrings don't work due to the variable length.


I'm very inexperienced in vb and this kind of string manipulation is new to me.


Thank you


Aucun commentaire:

Enregistrer un commentaire