VB返回值问题
来源:百度知道 编辑:UC知道 时间:2024/05/12 16:32:27
程序段:
str1="98765"
str2="65"
s=IntStr(str1,str2)
s的返回值是多少?(请给出具体的分析过程)
str1="98765"
str2="65"
s=IntStr(str1,str2)
s的返回值是多少?(请给出具体的分析过程)
你的字符串函数写错了,应该是inStr
s=IntStr(str1,str2) 的意思是
查找str1中str2出现的位置并赋值给s
65在98765中出现在第四个字符的位置,所以返回值为4
s的返回值是4
IntStr 改 InStr
Private Sub Command1_Click()
str1 = "98765"
str2 = "65"
s = InStr(str1, str2)
Text1.Text = s
End Sub