网站首页  词典首页

请输入您要查询的函数:

 

术语 lstrcmpi
释义 lstrcmpi
语法:
int lstrcmpi( LPCTSTR lpString1,
LPCTSTR lpString2
);
lstrcmpi函数
比较两个字符串。这种比较是不区分大小写。
要执行的比较是区分大小写,使用lstrcmp功能。
参数
lpString1
[in]指向第一个空结尾的字符串进行比较。
lpString2
[in]指向第二个空结尾的字符串进行比较。
返回值
如果字符串指向lpString1是小于字符串指出lpString2的,则返回值为负。如果字符串指向lpString1比字符串更大指出lpString2的,返回值是积极的。如果字符串相等,则返回值为0。
备注
该lstrcmpi函数通过检查比较互相的第一个字符两个字符串,对对方的第二个字符,依此类推,直到找到一个不平等或达到的字符串的结束。
请注意,lpString1和lpString2参数必须空终止,否则字符串比较是不正确的。
函数调用CompareString,使用当前线程的区域设置,结果减去2,保持C运行时间比较字符串公约。
对于某些区域设置的lstrcmpi函数可能是不够的。如果发生这种情况,使用CompareString,以确保适当的比较。例如,在要求日本与NORM_IGNORECASE,NORM_IGNOREKANATYPE,并NORM_IGNOREWIDTH值达到最适当的不准确的字符串比较。在NORM_IGNOREKANATYPE和NORM_IGNOREWIDTH值将被忽略非亚洲语言环境中,您可以为所有的区域设置这些值,并保证有一个正确的文化“无动于衷”排序无论区域设置。请注意,指定这些值降低性能,因此使用它们只在必要时。
有了一个双字节字符集(DBCS)系统的版本,这个功能可以比较两个DBCS字符串。
该lstrcmpi函数使用一个字排序,而不是字符串排序。一个字排序对待不同的连字符和撇比对待其他符号的非字母数字,以确保词,如“笼”和“合作社”,停留在已排序的清单。对于各种各样的单词和字符串排序的详细讨论,请参阅该CompareString功能备注部分。
在Windows 95/98/Me:lstrcmpiW是支持微软层对于Unicode。要使用此,您必须将某些文件到您的应用,概述了对Unicode的Microsoft层在Windows 95/98/Me系统。
例如
有关示例,请参阅使用的系统版本。
功能信息
最低DLL版本 kernel32.dll
在Winbase.h HeaderDeclared,头文件:winuser.h
import libraryKernel32.lib
最低操作系统Windows 95,Windows NT 3.1
UnicodeImplemented为ANSI和Unicode版本。
参见
Strings 概述 ,整理,CompareString,CompareStringEx,CompareStringOrdinal,lstrcat,lstrcmp,lstrcpy,lstrlen
==英文原文==lstrcmpi Function
Compares two character strings. The comparison is not case-sensitive.
To perform a comparison that is case-sensitive, use the lstrcmp function.
Syntax
int lstrcmpi( LPCTSTR lpString1,
LPCTSTR lpString2
);
Parameters
lpString1
[in] Pointer to the first null-terminated string to be compared.
lpString2
[in] Pointer to the second null-terminated string to be compared.
Return Value
If the string pointed to by lpString1 is less than the string pointed to by lpString2, the return value is negative. If the string pointed to by lpString1 is greater than the string pointed to by lpString2, the return value is positive. If the strings are equal, the return value is zero.
Remarks
The lstrcmpi function compares two strings by checking the first characters against each other, the second characters against each other, and so on until it finds an inequality or reaches the ends of the strings.
Note that the lpString1 and lpString2 parameters must be null-terminated, otherwise the string comparison can be incorrect.
The function calls CompareString , using the current thread locale, and subtracts 2 from the result, to maintain the C run-time conventions for comparing strings.
For some locales, the lstrcmpi function may be insufficient. If this occurs, use CompareString to ensure proper comparison. For example, in Japan call with the NORM_IGNORECASE, NORM_IGNOREKANATYPE, and NORM_IGNOREWIDTH values to achieve the most appropriate non-exact string comparison. The NORM_IGNOREKANATYPE and NORM_IGNOREWIDTH values are ignored in non-Asian locales, so you can set these values for all locales and be guaranteed to have a culturally correct "insensitive" sorting regardless of the locale. Note that specifying these values slows performance, so use them only when necessary.
With a double-byte character set (DBCS) version of the system, this function can compare two DBCS strings.
The lstrcmpi function uses a word sort, rather than a string sort. A word sort treats hyphens and apostrophes differently than it treats other symbols that are not alphanumeric, in order to ensure that words such as "coop" and "co-op" stay together within a sorted list. For a detailed discussion of word sorts and string sorts, see the Remarks section for the CompareString function.
Windows 95/98/Me: lstrcmpiW is supported by the Microsoft Layer for Unicode. To use this, you must add certain files to your application, as outlined in Microsoft Layer for Unicode on Windows 95/98/Me Systems .
Example
For an example, see Getting the System Version .
Function Information
Minimum DLL Versionkernel32.dll
HeaderDeclared in Winbase.h, include Windows.h
Import libraryKernel32.lib
Minimum operating systemsWindows 95, Windows NT 3.1
UnicodeImplemented as ANSI and Unicode versions.
See Also
Strings Overview , Collation , CompareString , CompareStringEx , CompareStringOrdinal , lstrcat , lstrcmp , lstrcpy , lstrlen
==原始网址==http://msdn.microsoft.com/en-us/library/ms647489(VS.85).aspx\n
随便看

 

windows api函数参考手册包含2258条windows api函数文档,详细介绍nodejs、java、rust调用windows api的方法技巧,是学习windows api编程的入门中文文档。

 

Copyright © 2004-2023 Winrtm.com All Rights Reserved
京ICP备2021023879号-40 更新时间:2024/10/6 9:21:35