比如统计“c:\mp3\download\test.txt”中"\"数量在线等待,答对给分

解决方案 »

  1.   

    应该是没有,不过可以通过调用Instr()来实现。
      

  2.   

    Dim s As String, i As Integer
    s = "c:\mp3\download\test.txt"
    Do Until InStr(s, "\") = 0
      s = Mid(s, InStr(s, "\") + 1)
      i = i + 1
    Loop
    MsgBox i
      

  3.   

    dim lngR as long ,strWord() as string 
    strWord = split(“c:\mp3\download\test.txt”,"\")
    lngR = ubound(strword) + 1
      

  4.   

    通过mid,instr的方法我实现了,可是我估计VB中本来就有这种函数,自己做无用功;谢谢。
      

  5.   

    上面的lngR = ubound(strword) + 1不对。
    应该是lngR = ubound(strword)
      

  6.   

    谢谢:anosoft(全方) ,AechoJohn(江江) !结贴!!
      

  7.   

    Dim strWord() As String
    strWord = Split("acd,sdfsd,sdfsd,sdfsdt", ",")
    MsgBox UBound(strWord)