Function ExtractTextFromRight(inputString As String) As String
    Dim index As Integer
    Dim strLen As Integer
    Dim result As String

    ' 总字符长度
    strLen = Len(inputString)

    ' 查找第一个 "/"
    index = InStrRev(inputString, "/", strLen)

    ' 如果找到了 "/",则提取从右往左数第4位到 "/" 之间的内容
    If index > 0 Then
        result = Mid(inputString, index + 1, strLen - index - 3)
    Else
        result = ""
    End If

    ExtractTextFromRight = result
End Function
最后修改:2023 年 04 月 19 日
如果觉得我的文章对你有用,请随意赞赏