标题:求教!VB2005的问题
取消只看楼主
luwei5644
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-1-26
 问题点数:0 回复次数:1 
求教!VB2005的问题
Private Sub btnCompute2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles btnCompute2.Click
Dim count As Integer = 0, i As Integer
For i = 0 To (txtShuru.Text.Length() - 1)
If (txtShuru.Text(i).Equals(" "c)) Then Continue For
count += 1
Next
lblshow2.Text = "总共有" & count.ToString() & "字符!"
End Sub
这段代码是为了计算字符数时把空格不计算在内,为啥Equals(" "c)引号好面要加个c?小弟初学VB2005,
望高手赐教,小弟先谢谢了。
搜索更多相关主题的帖子: count Integer Sub 
2007-02-01 22:49
luwei5644
Rank: 1
等 级:新手上路
帖 子:3
专家分:0
注 册:2007-1-26
得分:0 
谢了
2007-02-05 17:51



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-119229-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.611225 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved