组卷题库 > 高中信息技术试卷库
试题详情
小明编写VB程序,实现从某一字符串删除指定的连续字符串,并将处理后的字符串重新输出,在文本框Text1中输入原始字符串,在文本框Text2中输入需要删除的连续字符串,单击Command1后,在文本框Text3中输出处理后的结果。实现该功能的VB程序段如下:

Dim x As Integer, result As String,p As String, k As String result = "":p = Text1.Text:k = Text2.Text

For x = 1 To Len(p) -Len(k) + 1

    If   ⑴    Then

        result = result + Mid(p, x, 1)

    Else

            ⑵    

    End If

Next x

Text3.Text =   ⑶    

上述程序段中横线处可选语句为:

① Mid(s, x, Len(k)) = k

② Mid(s, x, Len(k)) <>k

③ x = x +Len(k) – 1

④ x = x + Len(k)

⑤ result + Mid(p, x)

⑥ result

则(1)(2)(3)处填入的语句依次为(     )

A、①③⑤
B、②④⑥
C、②③⑤
D、①④⑥
知识点
参考答案
采纳过本试题的试卷
教育网站链接