How to get a text that is inside a quote vb.net

0
wscript.exe //B "C:\Users\S4LSAL~1\AppData\Local\Temp\virus.vbs"

And I wanted to get the route inside the quotes, so that this would stay:

C:\Users\S4LSAL~1\AppData\Local\Temp\virus.vbs

I can not do this on vb.net, thanks in advance.

    
asked by S4L salsoft 18.11.2018 в 04:45
source

1 answer

0

good day. Unfortunately, you do not give us many details about how the variable that contains the entire route that you give us comes, if you were more specific, we would appreciate it. On the other hand, I offer you this solution:

    Dim path As String = "wscript.exe //B 'C:\Users\S4LSAL~1\AppData\Local\Temp\virus.vbs'"
    Dim i As Integer = path.IndexOf("'")
    Dim justpath As String = path.Substring(i + 1, path.IndexOf("'", i + 1) - i - 1)

With this you easily extract the string that is between the single quotes. I give you this solution since you do not give us more details. Greetings

    
answered by 18.11.2018 / 05:11
source