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语言函数使用的更多相关文章

  1. 实际项目开发过程中常用C语言函数的9大用法

    C语言是当中最广泛的计算机编程语言,是所有计算机编程语言的祖先,其他计算机编程语言包括当前流行的Java语言,都是用C语言实现的,C语言是编程效率最高的计算机语言,既能完成上层应用开发,也能完成底层硬 ...

  2. 学习LoadRunner之C语言函数

    学习LoadRunner之C语言函数 Action() { /*strchr和strrchr的区别*/ /* char *strTest1="citms citms"; char ...

  3. iOS_常用C语言函数

    一.随机数: 1.rand(); 范围:        0-无穷大. 特点:        仅第一次随机,其他次都是和第一次相同.常用于调试. 返回值:     long 实例:        int ...

  4. loadrunner常用web动作函数

    web_custom_request  ---允许使用任何http请求方法 脚本一: web_custom_request("baidu_request","URL=ht ...

  5. LoadRunner常用函数列表

    LoadRunner常用函数列表 Web相关函数 函 数 功  能  描  述 web_custom_request 用户可以通过该函数自行创建一个HTTP请求的函数 web_image 模拟用户单击 ...

  6. R语言学习 第八篇:常用的数据处理函数

    Basic包是R语言预装的开发包,包含了常用的数据处理函数,可以对数据进行简单地清理和转换,也可以在使用其他转换函数之前,对数据进行预处理,必须熟练掌握常用的数据处理函数,本文分享在数据处理时,经常使 ...

  7. 在LoadRunner中转换字符串大小写的C语言函数

    在LoadRunner中转换字符串大小写的C语言函数 . loadrunner语言ccharacterstringaction 封装ConvertToXXX函数: //ConvertToUpper f ...

  8. 【三支火把】---常用C语言控制台函数总结(持续更新)

    写了这么久的C程序,每次看到输出的结果都是从上往下排列的黑白框,有没有感觉很无聊啊?今天再次总结一个常用的控制台函数,能够帮助你做好一个好看的界面. 1.设置光标位置代码如下: int main(vo ...

  9. PYTHON语言之常用内置函数

    一 写在开头本文列举了一些常用的python内置函数.完整详细的python内置函数列表请参见python文档的Built-in Functions章节. 二 python常用内置函数请注意,有关内置 ...

随机推荐

  1. [转][Android]FragmentPagerAdapter与FragmentStatePagerAdapter使用详解与区别

    原文链接:http://blog.csdn.net/zhaokaiqiang1992 FragmentPagerAdapter是android-support-v4支持包里面出现的一个新的适配器,继承 ...

  2. tomcat bin 中startup.sh中的环境变量配置

    JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64 JRE_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64/jre P ...

  3. 使用CSS中margin和padding的基础和注意事项

    在CSS中,margin和padding是页面布局的主要属性,如何灵活有效使用对于基于DIV+CSS设计网页方法是非常重要的,笔者经常使用且经常误使用,所以根据经验和网上资料整理出切合自己的内容,以备 ...

  4. sql server 行转列(转载)

    SQL Server中行列转换 Pivot UnPivot PIVOT用于将列值旋转为列名(即行转列),在SQL Server 2000可以用聚合函数配合CASE语句实现 PIVOT的一般语法是:PI ...

  5. 【linux】ubuntu stmp服务器配置

    来源:http://blog.itpub.net/786540/viewspace-1002077/ sudo apt-get install sendmail(其中已经包含了sendmail-bin ...

  6. 获取driver网络路径名称

    'get the web path of the drive s: Dim MM As New Management.ManagementObject(String.Format("win3 ...

  7. July 4th, Week 28th Monday, 2016

    Goals determine what you are going to be. 你的目标决定你将成为怎样的人. What are your goals? What kind of people y ...

  8. Eclipse CDT launch failed.Binary not found in Linux/Ubuntu

    转自:http://blog.csdn.net/abcjennifer/article/details/7573916 Linux下出现launch failed.Binary not found的解 ...

  9. WEB前端开发学习:源码canvas 雪

    WEB前端开发学习:源码canvas 雪 双旦节要到了,程序员们为了响应气氛,特别用代码制作了动态雪花,WEB前端开发学习的初学者们一起跟着案例做一遍吧! <!DOCTYPE html> ...

  10. ZooKeeper 配置文件(zoo.cfg)详解

    参数名 说明 clientPort 客户端连接server的端口,即对外服务端口,一般设置为2181吧. dataDir 存储快照文件snapshot的目录.默认情况下,事务日志也会存储在这里.建议同 ...