Rss & SiteMap
Foxtable(狐表) http://www.foxtable.com
,“AAA00000”后边的字符个数固定吗?
这样简单点:
Dim s As String = "一二三四五AAA00000六七八"
For i As Integer = 0 To s.Length -3
If s(i) = s(i+1) AndAlso s(i) = s(i+2) Then
If s(i+3) = s(i+4) AndAlso s(i+3) = s(i+5) AndAlso s(i+3) = s(i+6) AndAlso s(i+3) = s(i+7) Then
messagebox.show(s.SubString(i,8))
Exit For
End If
End If
Next
回复狐狸爸爸:"AAA00000"只是个样式,AAA代表任意三位字母,00000代表任意五位数字。所以您的这段代码好像行不通吧。 |
这样简单点:
Dim s As String = "一二三四五AAA00000六七八"
For i As Integer = 0 To s.Length -3
If s(i) = s(i+1) AndAlso s(i) = s(i+2) Then
If s(i+3) = s(i+4) AndAlso s(i+3) = s(i+5) AndAlso s(i+3) = s(i+6) AndAlso s(i+3) = s(i+7) Then
messagebox.show(s.SubString(i,8))
Exit For
End If
End If
Next
弄糊涂了,狐狸爸爸能不能用解释含义