loadrunner常用函数_LoadRunner常用函数之--stricmp 函数,完成2个字符串的比较
发布日期:2021-06-24 15:58:36 浏览次数:2 分类:技术文章

本文共 1040 字,大约阅读时间需要 3 分钟。

Performs a case-insensitive comparison of two strings.

intstricmp ( const char *string1, const char *string2 );

string1The first string for comparison.

string2The second string for comparison.

Example

int result;

char tmp[20];

char string1[] = "The quick brown dog jumps over the lazy fox";

char string2[] = "The QUICK brown dog jumps over the lazy fox";

result = strcmp( string1, string2 ); /* Case-sensitive comparison */

if( result > 0 )

strcpy( tmp, "greater than" );

else if( result < 0 )

strcpy( tmp, "less than" );

else

strcpy( tmp, "equal to" );

lr_output_message( "strcmp: String 1 is %s string 2", tmp );

result = stricmp( string1, string2 ); /* Case-insensitive comparison */

if( result > 0 )

strcpy( tmp, "greater than" );

else if( result < 0 )

strcpy( tmp, "less than" );

else

strcpy( tmp, "equal to" );

lr_output_message( "stricmp: String 1 is %s string 2", tmp );

return 0;

}

Result

Action.c(17): strcmp: String 1 is greater than string 2

Action.c(28): stricmp: String 1 is equal to string 2

最后修改于 2006-04-10 10:31

阅读(?)评论(0)

转载地址:https://blog.csdn.net/weixin_33701632/article/details/111943502 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:pytorch tensor 初始化_PyTorch简明笔记[1]-Tensor的初始化和基本操作
下一篇:python画图猪_用Python的turtle画一只小猪乔治【刚学python两天,记念一下】

发表评论

最新留言

感谢大佬
[***.8.128.20]2024年04月26日 00时12分01秒