我有一個字符串變量:VB.net環和拆分功能文本處理
p_text = "}{X=45,Y=65}{X=59,Y=65}{X=59,Y=79}{X=45,Y=79}{"
與此代碼
Dim p_text As String
Dim s1_texts As String()
Dim s2_texts As String()
Dim s3_texts As String()
s1_texts = Split(p_text, "}{")
Dim numi As Integer = 0
Dim numj As Integer = 0
Dim numk As Integer = 0
Do Until numi = s1_texts.Length - 1
If s1_texts(numi) = "" Then
numi += 1
Else
s2_texts = Split(s1_texts(numi), ",")
Do Until numj = s2_texts.Length - 1
If s2_texts(numj) = "" Then
numj += 1
Else
s3_texts = Split(s2_texts(numj), "=")
Do Until numk = s3_texts.Length - 1
TextBox4.Text = TextBox4.Text & s3_texts(numk) & vbCrLf
numk += 1
Loop
numj += 1
End If
Loop
numi += 1
End If
Loop
而且我想TextBox4顯示:
X
Y
X
Ÿ
.......
但我只得到:
X
X
X
...
問題出在哪裏?
看到我的答案找一下你的代碼錯誤以及如何糾正他們 –