net 2.0 and need to split the last / mark of the string. Currently I have a code that says Dim test As String = "Software\Microsoft\Windows\Welcome"
and need a code that will split that Software\Microsoft\Windows\Welcome into two separate section at the end
So I'll have Software\Microsoft\Windows and Welcome as new strings.
I can only find things that will split the beginning from the rest like
Dim whole As String = "Software/Microsoft/Windows/Run"
Dim firstpart As String = whole.Substring(0, whole.IndexOf("/"))
Dim lastpart As String = whole.Substring(whole.IndexOf("/") + 1)`
Use String.LastIndexOf()
Dim whole As String = "Software/Microsoft/Windows/Run"
Dim firstpart As String = whole.Substring(0, whole.LastIndexOf("/"))
Dim lastpart As String = whole.Substring(whole.LastIndexOf("/") + 1)
Try splitting with '\' As your delimeter and store it as a string array. Then just grab the last element and it should be "Welcome".
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With