如何在 C/C++ 中使 strcmp/strncmp 不区分大小写
要使 strcmp 不区分大小写,使用 #include <strings.h> 中的 strcasecmp。strcasecmp 的使用方式与 strcmp 完全相同。
要使 strncmp 不区分大小写,使用 #include <strings.h> 中的 strncasecmp。strncasecmp 的使用方式与 strncmp 完全相同。
注意这两者都不会正确处理 unicode 字符,但在大多数应用程序中工作得很好。
Check out similar posts by category:
C/C++
If this post helped you, please consider buying me a coffee or donating via PayPal to support research & publishing of new posts on TechOverflow