VB 截取字符串

[复制链接]
查看11 | 回复5 | 2009-5-13 11:45:24 | 显示全部楼层 |阅读模式
截取字符串中右边第一个"/"以后的部分 Function RightStr(s As String) As String Dim i As Integeri = Len(s) While Mid$(s, i, 1)"/" i = i - 1 Wend RightStr = Mid$(s, i + 1, Len(s)) End Function...
回复

使用道具 举报

千问 | 2009-5-13 11:45:24 | 显示全部楼层
dim temp() as string dim fullname as string dim filename as string fullname=".200905/2009/mjch[2009]59fj.zip " temp=split(fullname,"/") filename=temp(2)...
回复

使用道具 举报

千问 | 2009-5-13 11:45:24 | 显示全部楼层
Dim a, b, c As StringPrivate Sub Form_Click()Print Right$(a, 18)Print Right$(b, 15)Print Right$(c, 16)End SubPrivate Sub Form_Load()a = ".200905/2009/mjch[2009]59fj...
回复

使用道具 举报

千问 | 2009-5-13 11:45:24 | 显示全部楼层
Dim AnyString, MyStrAnyString = "200905/2009/mjch[2009]59fj.zip"
MyStr =
Mid(AnyString, 13, 20) MyStr 就是你要的13为第13位开始截取 向后去20位...
回复

使用道具 举报

千问 | 2009-5-13 11:45:24 | 显示全部楼层
前面.200905/2009/是固定的吗,left(fullname,14,(size(fullname)-14))。差不多就是这个思路了,太久没用VB了,又是用手机上的,只能说个思路给你。...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行