以文本方式查看主题

-  Foxtable(狐表)  (http://www.foxtable.com/bbs/index.asp)
--  专家坐堂  (http://www.foxtable.com/bbs/list.asp?boardid=2)
----  [求助]为什么不能区分全角和半角括号  (http://www.foxtable.com/bbs/dispbbs.asp?boardid=2&id=138084)

--  作者:天一生水
--  发布时间:2019/7/22 18:54:00
--  [求助]为什么不能区分全角和半角括号
代码如下,运行结果为“true”,为什么?
怎样区分呢?


图片点击可在新窗口打开查看此主题相关图片如下:截屏图片.jpg
图片点击可在新窗口打开查看

\'\'\'
Dim str1 As String = "(2018)鲁01行终795号"    \'全角括号
Dim str2 As String = "(2018)鲁01行终795号"      \'半角括号
If str1 = str2 Then
    msgbox(True)
Else
    msgbox(False)
End If


[此贴子已经被作者于2019/7/22 18:55:17编辑过]

--  作者:有点蓝
--  发布时间:2019/7/22 20:32:00
--  
Foxtable是大小写不敏感的,要这样判断:

\'\'\'
Dim str1 As String = "(2018)鲁01行终795号"    \'全角括号
Dim str2 As String = "(2018)鲁01行终795号"      \'半角括号
If str1.Equals( str2) Then
    msgbox(True)
Else
    msgbox(False)
End If