ITPub博客

首页 > 应用开发 > IT综合 > VB超频快餐之三(转)

VB超频快餐之三(转)

原创 IT综合 作者:BugRobber 时间:2007-07-08 11:39:01 0 删除 编辑
2、更加简练的方法:

If Instr(";winter;spring;summer;fall;", ";" & word & ";") Then

' it is a season's name

End If

有时候,甚至可以使用InStr来替代Select

Case代码段,但一定要注意参数中的字符数目。下面的例子中,转换数字0到9的相应英文名称为阿拉伯数字: 1、普通的方法:

Select Case LCase$(word)

Case "zero"

result = 0

Case "one"

result = 1

Case "two"

result = 2

Case "three"

result = 3

Case "four"

result = 4

Case "five"

result = 5

Case "six"

result = 6

Case "seven"

result = 7

Case "eight"

result = 8

Case "nine"

result = 9

End Select[@more@]

来自 “ ITPUB博客 ” ,链接:https://blog.itpub.net/8781179/viewspace-925220/ ,如需转载,请注明出处,否则将追究法律责任。

请登录后发表评论 登录
全部评论
  • 博文量
    372
  • 访问量
    200880