单项选择题要求函数的功能是:从参数str字符串中删除所有参数ch所指定的字符,返回实际删除字符的个数,删除后的字符串仍在str中,为此某人编写了函数DelChar如下: Function DelChar(str As String, ch As String) As Integer Dim n%, st st = n = 0 For k = 1 To Len(str) c = Mid(str, k, 1) If c = ch Then st = st & c Else n = n + 1 End If Next k str = st DelChar = n End Function 并用下面的Command1_Click()过程观察函数调用结果 Private Sub Command1_Click() ch$ = Text1.Text Print DelChar(ch, x ), ch End Sub 发现结果有错误,程序代码需要修改,以下正确的修改方案是________。
A.把语句Print DelChar(ch, 'x'), ch改为Print DelChar(ch, 'x') :Print ch
B.把语句DelChar = n 改为 DelChar = st
C.删掉语句str = st
D.把语句If c = ch Then 改为If c ch Then