LoadRunner 常用C语言函数使用
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);
strncat:拼接指定长度字符换
char
str[100]="容我想想";
char
str1[100]="老师之性能测试系列培训课程";
char
*str2;
str2 = (char
*)strncat(str,str1,22);
lr_output_message("str1的值为%s",str2);
memcpy:拷贝指定长度的字符串
char
str[100]="容我想想老师之性能测试系列培训课程";
char
str1[100]="";
memcpy(str1,str,30);
lr_output_message("str1的值为%s",str1);
memcmp:比较指定长度的字符串
char
str[100]="容我想想老师之性能测试系列培训课程TEST";
char
str1[100]="容我想想老师之性能测试系列培训课程";
int
num;
num
= memcmp(str1,str,34);
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");
LoadRunner 常用C语言函数使用的更多相关文章
- 实际项目开发过程中常用C语言函数的9大用法
C语言是当中最广泛的计算机编程语言,是所有计算机编程语言的祖先,其他计算机编程语言包括当前流行的Java语言,都是用C语言实现的,C语言是编程效率最高的计算机语言,既能完成上层应用开发,也能完成底层硬 ...
- 学习LoadRunner之C语言函数
学习LoadRunner之C语言函数 Action() { /*strchr和strrchr的区别*/ /* char *strTest1="citms citms"; char ...
- iOS_常用C语言函数
一.随机数: 1.rand(); 范围: 0-无穷大. 特点: 仅第一次随机,其他次都是和第一次相同.常用于调试. 返回值: long 实例: int ...
- loadrunner常用web动作函数
web_custom_request ---允许使用任何http请求方法 脚本一: web_custom_request("baidu_request","URL=ht ...
- LoadRunner常用函数列表
LoadRunner常用函数列表 Web相关函数 函 数 功 能 描 述 web_custom_request 用户可以通过该函数自行创建一个HTTP请求的函数 web_image 模拟用户单击 ...
- R语言学习 第八篇:常用的数据处理函数
Basic包是R语言预装的开发包,包含了常用的数据处理函数,可以对数据进行简单地清理和转换,也可以在使用其他转换函数之前,对数据进行预处理,必须熟练掌握常用的数据处理函数,本文分享在数据处理时,经常使 ...
- 在LoadRunner中转换字符串大小写的C语言函数
在LoadRunner中转换字符串大小写的C语言函数 . loadrunner语言ccharacterstringaction 封装ConvertToXXX函数: //ConvertToUpper f ...
- 【三支火把】---常用C语言控制台函数总结(持续更新)
写了这么久的C程序,每次看到输出的结果都是从上往下排列的黑白框,有没有感觉很无聊啊?今天再次总结一个常用的控制台函数,能够帮助你做好一个好看的界面. 1.设置光标位置代码如下: int main(vo ...
- PYTHON语言之常用内置函数
一 写在开头本文列举了一些常用的python内置函数.完整详细的python内置函数列表请参见python文档的Built-in Functions章节. 二 python常用内置函数请注意,有关内置 ...
随机推荐
- java入门 第三季2
java中的字符串 java中的常用类
- Vue 为什么在 HTML 中监听事件?
为什么在 HTML 中监听事件? 你可能注意到这种事件监听的方式违背了关注点分离(separation of concern)传统理念.不必担心,因为所有的 Vue.js 事件处理方法和表达式都严格绑 ...
- eclipse下使用git下载和上传项目
简单配置,填入我们的用户名和邮箱 >>Preferences>Team>Git>Configuration 点击Add Entry,在弹出框里面输入key和value的值 ...
- 【leetcode】Kth Largest Element in an Array (middle)☆
Find the kth largest element in an unsorted array. Note that it is the kth largest element in the so ...
- URAL 2019 Pair: normal and paranormal (贪心) -GDUT联合第七场
比赛题目链接 题意:有n个人每人拿着一把枪想要杀死n个怪兽,大写字母代表人,小写字母代表怪兽.A只能杀死a,B只能杀死b,如题目中的图所示,枪的弹道不能交叉.人和怪兽的编号分别是1到n,问是否存在能全 ...
- 【XLL API 函数】xlSheetId
查找命名的工作表ID,用于外部引用. 原型 Excel12(xlSheetId, LPXLOPER12 pxRes, 1, LPXLOPER12 pxSheetName); 参数 pxSheetNam ...
- 【XLL 文档翻译】【第1部分】 Add-in 管理器 和 XLL 接口函数
xlAddInManagerInfo/xlAddInManagerInfo12 在 Excel 会话中,每一次调用 Add-In 管理器时,系统会调用这两个函数.此函数可以在 Add-In 管理器中提 ...
- rsync.conf详解
1.在服务端编辑配置文件 [root@game_intf ~]# more /etc/rsyncd.conf port=8730 log file=/var/log/rsync.log pid fil ...
- 隐藏<input type="file"> 实现点击div或图片打开文件选择路径
HTML: <input type="file" style="display:none" id="addfile-btn"> ...
- 清除Windows系统桌面快捷方式小箭头
清除Windows桌面快捷方式小箭头,需要重启,且不会导致软件无法锁定到任务栏.新建.reg的注册表文件,命名随意,内容如下: Windows Registry Editor Version 5.00 ...