我怎样才能转换下面的字符串,
"[""1"",""2"",""3""]"
对此,
["1","2","3"]
我试过这个没有成功:
Replace(string, """", "")
我怎样才能转换下面的字符串,
"[""1"",""2"",""3""]"
对此,
["1","2","3"]
我试过这个没有成功:
Replace(string, """", "")
如果我理解正确,你可以尝试这样的事情:
Dim s As String = "[""1"",""2"",""3""]"
Dim collection As System.Text.RegularExpressions.MatchCollection = System.Text.RegularExpressions.Regex.Matches(s, "\d+")
Dim svals As String = ""
For Each m As System.Text.RegularExpressions.Match In collection
If svals = String.Empty Then
svals = m.Value
Else
svals = svals & "," & m.Value
End If
Next
Dim rr() As String
rr = svals.Split(",") ' Result as array of string
在 vb.net - 你应该这样尝试,
Dim stringVar As String = "[""1"",""2"",""3""]"
stringVar.Replace("""", "")
还要检查此项以使用替换功能。