LoadRunner常用C语言函数使用
作者:网络转载 发布时间:[ 2015/11/20 14:07:11 ] 推荐标签:性能测试工具 软件测试工具
strlen:获取字符串的长度
char str[20]="容我想想";
int len;
len = strlen(str);
lr_output_message("str的长度=%d",len);
Action.c(9): str的长度=8
strupr:将小写字母转化为大写字母
char str[20] ="Welcome to the HP LoadRunner Online Function Reference";
char *str1 = NULL;
str1 = (char *)strupr(str);
lr_output_message("str的内容转化为大写为%s",str1);
strlwr:将小写字母转化为大写字母
char str[20] ="RONGWOXIANGXIANG";
char *str1 = NULL;
lr_output_message("str的内容转化为小写为%s",strlwr(str));
strrchr:在字符串中查找指定字符后一次出现
char *str="Welcome to the HP LoadRunner Online Function Reference";
char *str1;
str1 = (char *)strrchr(str,'c');
lr_output_message("c 后一次出现时在%s",str1);
strchr:在字符串中查找字符第一次出现
char *str="Welcome to the HP LoadRunner Online Function Reference";
char *str1;
str1 = (char *)strchr(str,'c');
lr_output_message("c第一次出现是在%s",str1);
strncpy:拷贝指定长度的字符串
char str[100]="容我想想老师之性能测试系列培训课程";
char str1[100];
strncpy(str1,str,8);
lr_output_message("str的值为%s",str1);
strcpy:拷贝字符串
char str[100]="容我想想老师之性能测试系列培训课程";
char str1[100];
strcpy(str1,str);
lr_output_message("str的值为%s",str1);
strnicmp:不区分大小写比较指定长度的字符串
char str[100] ="Welcome to the HP LoadRunner Online Function Reference";
char str1[100]="WELCOME TO THE HP LOADRUNNER ONLINE FUNCTION REFERENCE";
int num;
num = strnicmp(str,str1,10);
if(num == 0)
lr_output_message("str == str1");
else if(num > 0)
lr_output_message("str > str1");
else if(num < 0)
lr_output_message("str < str1");
stricmp:不区分大小写比较字符串
char str[100] ="Welcome to the HP LoadRunner Online Function Reference";
char str1[100]="WELCOME TO THE HP LOADRUNNER ONLINE FUNCTION REFERENCE";
int num;
num = stricmp(str,str1);
if(num == 0)
lr_output_message("str == str1");
else if(num > 0)
lr_output_message("str > str1");
else if(num < 0)
lr_output_message("str < str1");
strncmp:比较指定长度字符串
char str[100] = "Welcome to the HP LoadRunner Online Function Reference";
char str1[100]= "Welcome TO THE HP LOADRUNNER ONLINE FUNCTION REFERENCE";
int num;
num = strncmp(str,str1,8);
if(num == 0)
lr_output_message("str == str1");
else if(num > 0)
lr_output_message("str > str1");
else if(num < 0)
lr_output_message("str < str1");
strncmp:字符串比较
char str[100] = "Welcome to the HP LoadRunner Online Function Reference";
char str1[100]= "Welcome TO THE HP LOADRUNNER ONLINE FUNCTION REFERENCE";
int num;
num = strcmp(str,str1);
if(num == 0)
lr_output_message("str == str1");
else if(num > 0)
lr_output_message("str > str1");
else if(num < 0)
lr_output_message("str < str1");
strcat:拼接字符串
char str[100]="容我想想";
char str1[100]="老师之性能测试系列培训课程";
char *str2;
str2 = (char *)strcat(str,str1);
lr_output_message("str1的值为%s",str2);
相关推荐
更新发布
功能测试和接口测试的区别
2023/3/23 14:23:39如何写好测试用例文档
2023/3/22 16:17:39常用的选择回归测试的方式有哪些?
2022/6/14 16:14:27测试流程中需要重点把关几个过程?
2021/10/18 15:37:44性能测试的七种方法
2021/9/17 15:19:29全链路压测优化思路
2021/9/14 15:42:25性能测试流程浅谈
2021/5/28 17:25:47常见的APP性能测试指标
2021/5/8 17:01:11