Visual Basic判断字符串最大连号数,比如12233444返回3,因为444是三连号
dim n = 0 dim max = 0 for i = 2 to len(s) if mid(s,i,1)=mid(s,i-1,1) then n = n + 1 else if n > max then max = n n = 1 end if next msgbox max