M
^MisterJingo^
Hi all,
I have a variable called root which contains
(E:\Web\Websites\fileBrowse\) and then I have a variable called path
which uses root, and adds directories on to it (this is part of a file
browser i've built). I'm trying to simply remove the root string from
the path string, so for example below:
root = E:\Web\Websites\fileBrowse\
path = E:\Web\Websites\fileBrowse\images\
the result I want should be "images\"
I'm attempting to do this using the following line of code:
blah = path.TrimStart(root.ToCharArray());
This isn't working though. Instead of getting "images\", i'm getting
"ages\". I've tried trimming using a start and end element of the char
array but I still get the same result. It seems that for some reason
the "\" which is trimmed at the end of root is taken as a control
character and so takes the proceding two characters too "im".
Has anyone got any idea how to stop this happening? I'm hoping it's
something simple which i'm overlooking.
Any help would be appreciated.
I have a variable called root which contains
(E:\Web\Websites\fileBrowse\) and then I have a variable called path
which uses root, and adds directories on to it (this is part of a file
browser i've built). I'm trying to simply remove the root string from
the path string, so for example below:
root = E:\Web\Websites\fileBrowse\
path = E:\Web\Websites\fileBrowse\images\
the result I want should be "images\"
I'm attempting to do this using the following line of code:
blah = path.TrimStart(root.ToCharArray());
This isn't working though. Instead of getting "images\", i'm getting
"ages\". I've tried trimming using a start and end element of the char
array but I still get the same result. It seems that for some reason
the "\" which is trimmed at the end of root is taken as a control
character and so takes the proceding two characters too "im".
Has anyone got any idea how to stop this happening? I'm hoping it's
something simple which i'm overlooking.
Any help would be appreciated.