如何识别输入框的值是否为掩码?
How to identify if an input box value is a mask?
如何判断传递给其他页面的输入框值是否为掩码?
我有这样的代码:
number = Request("Cnumber") 'value from an input box
Request("Cnumber")
的输出是这样的:
xxxxxxxxxxxx5555
我想检查 number
的值,如下所示:
if number(having an X value on the left) then
use another value
end if
如何在 If
语句条件下应用它?
正如指出的,只需检查字符串开头的第一个字符:
If Left(Request("Cnumber"), 1) = "x" Then
'use another value
End If
如果要使比较不区分大小写,请添加LCase
:
If LCase(Left(Request("Cnumber"), 1)) = "x" Then
'use another value
End If
如何判断传递给其他页面的输入框值是否为掩码?
我有这样的代码:
number = Request("Cnumber") 'value from an input box
Request("Cnumber")
的输出是这样的:
xxxxxxxxxxxx5555
我想检查 number
的值,如下所示:
if number(having an X value on the left) then
use another value
end if
如何在 If
语句条件下应用它?
正如
If Left(Request("Cnumber"), 1) = "x" Then
'use another value
End If
如果要使比较不区分大小写,请添加LCase
:
If LCase(Left(Request("Cnumber"), 1)) = "x" Then
'use another value
End If