Private Sub Command1_Click()
    Dim strTest As String
    
    strTest = "d:\test.txt"
    
    MsgBox Right(strTest, Len(strTest) - InStr(1, strTest, "\"))End Sub

解决方案 »

  1.   

     
        Dim strTest As String
        
        strTest = "c:\test.txt"
        
        MsgBox Mid(strTest, InStr(1, strTest, "\") + 1)
     
      

  2.   

    用instr,也可以用Split
    a=instr(1,字符串,"\")
    得到\的位置
    b=left(字符串,len(字符串)+a+1)
    得到你字符串a=split(字符串,"\")
    得到按“\”断开的数组
      

  3.   

    dim a as integer
    dim str as string
    str=....\......
    a=instr(0,str,"\")+1
    qqq=mid(str,a,len(str)-a)
    前提是STR有‘\',需要加上判断条件才完整
    这是一个本办法 
      

  4.   

    'Dim intCount As Integer
    'For intCount = Len(Pathname) To 1 Step -1
    '    If Mid(Pathname, intCount, 1) = "\" Then
    '       Exit For
    '    End If
    'Next intCount
    'StripPath = Mid(Pathname, intCount + 1, Len(Pathname) - intCount)
      

  5.   

    用right,和instr函数
    假设字符串为str,
    right(str,len(str)-instr(1,str,"\"))
      

  6.   

    上面写错的 是:)
    mid(str,instr(str,"\")+1)