Dim mystring as string = " myintref="567" Mynewref="345" "
我想在每个单引号上拆分mystring,以便最终得到;
myintref= 567
Mynewref= 345
无论
Dim splitstring as string() = mystring.Split(""")
或
Dim splitstring as string() = mystring.Split(New Char {"""c})
似乎有效。有什么建议? (vs2015,vb.net v14)
答案 0 :(得分:3)
要在VB中转义双引号,只需使用两个连续的双引号字符。所以你可以这样做:
width: 100%;
position: absolute;
top: calc(50% - 10px);
left: 50%;
height: calc(100%);
-webkit-transform: translateY(-50%) translateX(-50%);
这导致将字符串拆分为双引号字符:
答案 1 :(得分:0)
在分割该字符串后,您期待2个或4个元素吗?
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim strLine As String = " myintref=" & """" & "567" & """" & " Mynewref=" & """" & "345" & """" & " "
Debug.WriteLine("Original: " & strLine)
Dim strAry As String() = strLine.Split({""""c})
For i As Int32 = 0 To strAry.Length - 1
Debug.WriteLine(strAry(i))
Next
End Sub
给我这个输出:
Original: myintref="567" Mynewref="345"
myintref=
567
Mynewref=
345