 VB6 检查前面是否一样的子程序 f_chkLeft(strL As String, strC As String)
 VB6 检查前面是否一样的子程序 f_chkLeft(strL As String, strC As String)新建From1(窗体),新建Command1(按钮CommandButton),代码:
Private Function f_chkLeft(strL As String, strC As String)
    If Left(strL, Len(strC)) = strC Then
        f_chkLeft = True
    Else
        f_chkLeft =  False
    End If
End Function
Private Sub Command1_Click()
    Dim strL As String
    strL = "hello"
    MsgBox f_chkLeft(strL, "he")
End Sub运行结果:
True如果需要判断大小写,请先整理。