字符串=字符串比较样式(理论?)字符串、样式、理论

由网友(姐很高也很傲)分享简介:我无法测试code出去了(没笔记本),但在如果语句如下:I can't test the code out at the moment (no laptop), but in a If statement as below:Dim StrA As String, StrB As StringIF StrA = St...

我无法测试code出去了(没笔记本),但在如果语句如下:

I can't test the code out at the moment (no laptop), but in a If statement as below:

Dim StrA As String, StrB As String

IF StrA = StrB Then
   'code for true result
Else
   'code for false result
End If

请问如果语句检查字符串以二进制或文字的方式?

Does the Ifstatement check the strings in a binary or textual manner?

推荐答案

比较通常是文本,STRA = STRA,但您可以使用STRCOMP:

The comparison is usually textual, stra=STRA, but you can use StrComp:

 StrComp("stra","STRA",vbbinarycompare)

的http://office.microsoft.com/en-ie/access-help/strcomp-function-HA001228914.aspx

Sub IsIt()
'Option Compare Database (default): True
'Option Compare Text : True
'Option Compare Binary : False
If "stra" = "STRA" Then
    Debug.Print True
Else
    Debug.Print False
End If
End Sub
阅读全文

相关推荐

最新文章