会员登录 - 用户注册 - 网站地图 Office中国(office-cn.net),专业Office论坛
当前位置:主页 > 技巧 > Access技巧 > 模块函数VBA > 正文

获取字符串中特定字符的个数

时间:2005-02-04 10:15 来源:Office中国/Access中国 作者:情比金坚… 阅读:

Benjamin_luk 的方法 :

Public Function CSNumber(myStr as String,myLetter as String) as integer
dim I as integer,J as integer
J=0
for I = 1 to Len(myStr)
 if MID(myStr,I,1)=myLetter  then
  J=J+1
  End if
Next
CSNumber=J
End Function

相关论坛贴子: http://www.office-cn.net/bbs/dispbbs.asp?boardid=2&id=21901

情比金坚的方法

strc = Len(name1) - Len(Replace(name1, ",", ""))

-------------------------------------------
收集于Office中国论坛

(责任编辑:admin)

顶一下
(0)
0%
踩一下
(0)
0%
发表评论
请自觉遵守互联网相关的政策法规,严禁发布色情、暴力、反动的言论。
评价: