简体   繁体   English

从vb.net中的字符串中提取双引号中的字符

[英]Extract characters in double quotes from a string in vb.net

vb.net ,我将如何提取以下字符串的路径,以便最终得到: C:\\Users\\User\\AppData\\Roaming\\HDH\\hds_remove.vbs

CSCRIPT //NOLOGO "C:\Users\User\AppData\Roaming\HDH\hds_remove.vbs"

First call IndexOf to get the indices of the quotes. 首先调用IndexOf以获取报价的索引。

Then call SubString to extract the path between the quotes. 然后调用SubString提取引号之间的路径。

Simply 只是

   Dim tex = "CSCRIPT //NOLOGO \"C:\Users\User\AppData\Roaming\HDH\hds_remove.vbs\""
   Dim substring As String = text.Substring(18, str.Length()-2)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM