Dim ss As String = "1,1,1,1,0,1,0,0,1,0,1,1,0,1,1" Dim ii As Integer = 0 For i As Integer = 0 To ss.Replace(",", "").Length - 1 If ss.Replace(",", "").Substring(i, 1) = "0" Then ii += 1 MsgBox("第" & i + 1 & "位是个0") End If Next MsgBox("一共有" & ii & "个0")
Dim ss As String = "1,1,1,1,0,1,0,0,1,0,1,1,0,1,1"
Dim ii As Integer = 0
For i As Integer = 0 To ss.Replace(",", "").Length - 1
If ss.Replace(",", "").Substring(i, 1) = "0" Then
ii += 1
MsgBox("第" & i + 1 & "位是个0")
End If
Next
MsgBox("一共有" & ii & "个0")