vb 关于字符问题

来源:百度知道 编辑:UC知道 时间:2024/06/05 19:07:41
如果list里有字符"c”,那么这个字符c转换成具体数字怎么写
If InStr(1,List1.Text, "c") > 0 Then c = 14
这么写不对啊

dim i as integer
for i=0 to list1.listcount-1
list1.List(i)=Replace(1, list1.List(i), "c", "14", , vbTextCompare)
next

应该是:
If InStr(List1.Text, "c") > 0 Then c = 14
'字符"c"在List1.Text中位置大于零,即list.Text里有字符"c”。