StrComp
来源:互联网 发布:看直播的软件 编辑:程序博客网 时间:2024/05/21 14:50
StrComp 为字符串比较的函数,不是标准数据类型的比较函数,==是标准数据类型的比较符,如果用==来比较字符串,相当于比较2字符串(数组)的首地址。compare参数为0或者省略时按二进制按顺序从第一个字符开始作比较字符串的ASCII值的大小,compare参数为1时按文本比较字符串大小且此时不区分大小写。
Requirements
Version 1
Returns a value indicating the result of a string comparison.
StrComp(string1, string2[, compare])
Arguments
- string1
- Required. Any valid string expression.
- string2
- Required. Any valid string expression.
- compare
- Optional. Numeric value indicating the kind of comparison to use when evaluating strings. If omitted, a binary comparison is performed. See Settings section for values.
Settings
The compare argument can have the following values:
Return Values
The StrComp function has the following return values:
Remarks
The following example uses the StrComp function to return the results of a string comparison. If the third argument is 1, a textual comparison is performed; if the third argument is 0 or omitted, a binary comparison is performed.
Dim MyStr1, MyStr2, MyCompMyStr1 = "ABCD": MyStr2 = "abcd" ' Define variables.MyComp =StrComp(
MyStr1,
MyStr2,
1)
' Returns 0.MyComp =StrComp(
MyStr1,
MyStr2,
0)
' Returns -1.MyComp =StrComp(
MyStr2,
MyStr1)
' Returns 1.
0 0
- StrComp
- StrComp
- StrComp 函数
- StrComp函数
- StrComp()函数的用法
- StrComp 和 StrIComp 函数
- 字符串比较----StrComp
- StrComp函数:对两个指定字符串进行比较
- 工厂方法模式与抽象工厂模式
- 115个Java面试题和答案——终极列表 (上)
- bzoj 4108: [Wf2015]Catering|带上下界最小费用可行流
- Can't place multiple pins assigned to pin location Pin_76
- 事件处理
- StrComp
- Linux虚拟机扩展文件系统
- 4、BOM编程 DOM编程(1)
- JAVA基础DAY1
- 插入排序
- HDOJ2008
- 初窥Servlet
- Python学习笔记12
- 第八周上机实践项目 项目3-指向学生类的指针