取文件名 放入变量 将文件名变成字符串进行删除, 将删除后的字符串重命名文件- Private Function DelStrInStr(oldstr As String, delstr As String) As String '删除指定字符串函数
- DelStrInStr = oldstr
- Dim a, oldlen, dellen As Integer
- a = InStr(oldstr, delstr)
- If a <> 0 Then
- oldlen = Len(oldstr)
- dellen = Len(delstr)
- DelStrInStr = Left(oldstr, a - 1) + Right(oldstr, oldlen - a + 1 - dellen)
- End If
- End Function
复制代码
|