Subtract one string from another

micropathic

Well-known member
Joined
Oct 23, 2003
Messages
75
How can I subtract one string from another in vb .net?

For instance:

if I have the string: "C:\Windows\Subdir1\Subdir2\Subdir3"

and another string like: "C:\Windows\Subdir1"

How can I return the remaining text "\Subdir2\Subdir3"

Thanks in advance for any help!
 
one way would be to use the inbuilt Replace function of a string...
Code:
Dim s1 As String = "C:\Windows\Subdir1\Subdir2\Subdir3"
Dim s2 As String = s1.Replace("C:\Windows\Subdir1" , "")
 
Back
Top