loadrunner中切割strtok字符串
http://blog.sina.com.cn/s/blog_7ee076050102vamg.html
http://www.cnblogs.com/lixiaohui-ambition/archive/2012/07/18/2598042.html
int in=0; int j; char buffer[100]="Fred male 25,John male 62,Anna female 16"; //char buffer[100]="Fred male 25";
char *p[20]; char *buf = buffer; while((p[in]=(char *)strtok(buf,","))!=NULL) { buf=p[in]; while((p[in]=(char *)strtok(buf," "))!=NULL) {
in++; buf=NULL;
} buf=NULL;
} lr_output_message("总共分割成:%d个字符串", in); for (j=0; j<in; j++) { lr_output_message(">%s<",p[j]); }
#include <stdio.h>
#include <string.h>
int main(int argc,char **argv)
{
char buf1[]="aaa,
,a,,,,bbb-c, , ,ee|abc";//必须为[],即字符串为有名字符串,而非匿名字符串 char* token = strtok( buf1, ",-|
");
while( token != NULL )
{
printf("%s", token
);
token = strtok( NULL, ",-|");
}
printf("\n");
return 0;
}
OUT 值:
aaa abbbc eeabc
loadrunner中切割strtok字符串的更多相关文章
- LoadRunner中常用的字符串操作函数
LoadRunner中常用的字符串操作函数有: strcpy(destination_string, source_string); strc ...
- loadrunner中切割字符串
下面函数的作用: http://blog.csdn.net/hgj125073/article/details/8447605 通过-与: 字符切割字符串,即-与:字符已经被\0 字符取代 char ...
- LoadRunner中字符串的操作
LoadRunner中字符串的操作 LoadRunner中常用的字符串操作函数有: strcpy(destination_string, source_string); ...
- LoadRunner中截取字符串
LoadRunner中截取字符串 /*strchr和strrchr的区别*/ char *strTest1="citms citms"; char *strTest2,*strTe ...
- shell 从变量中切割字符串
1. 在shell变量中切割字符串 shell中截取字符串的方法有很多中,${expression}一共有9种使用方法.${parameter:-word}${parameter:=word}${pa ...
- 在LoadRunner中转换字符串大小写的C语言函数
在LoadRunner中转换字符串大小写的C语言函数 . loadrunner语言ccharacterstringaction 封装ConvertToXXX函数: //ConvertToUpper f ...
- 在LoadRunner中查找和替换字符串
参考<Search & Replace function for LoadRunner>: http://ptfrontline.wordpress.com/2009/03/13/ ...
- LoadRunner中调用SHA1算法加密字符串
参考<SHA-1 hash for LoadRunner>: http://ptfrontline.wordpress.com/2010/03/02/sha-1-hash-for-load ...
- LoadRunner中的Web 函数列表
LoadRunner中的Web 函数列表 web test LoadRunner fuction_list D:\Program Files (x86)\Mercury Interactive\Mer ...
随机推荐
- MySQL\MariaDB 多线程复制初探
背景: MariaDB 在10.0.5就已经支持了并行复制的功能,即从库多线程复制的功能.MySQL最先在5.6.3中支持.目前暂时没有用MySQL5.6的版本,故暂时只对MariaDB进行一些说明, ...
- yii框架详解 之 国际化 (I18N)
我们要开启组件中们关于语言的配置,默认的就是CPhpMessageSource,也可以改为其他的方式. #组件配置中 'messages' => array( 'class'=> ...
- Effective C++ -----条款30:透彻了解inlining的里里外外
将大多数inlining限制在小型.被频繁调用的函数身上.这可使日后的调试过程和二进制升级(binary upgradability)更容易,也可使潜在的代码膨胀问题最小化,使程序的速度提升机会最大化 ...
- UVA 11827 Maximum GCD
F - Maximum GCD Time Limit:1000MS Memory Limit:0KB 64bit IO Format:%lld & %llu Given the ...
- struts 拦截器 Interceptor
拦截器是AOP中的概念,它本身是一段代码,可以通过定义“织入点”,来指定拦截器的代码在“织入点”的前后执行,从而起到拦截的作用.正如上面 Struts2的Reference中讲述的,Stru ...
- tableview详细介绍
tableview详细介绍: https://www.baidu.com/link?url=MU5a5om66vYEKAcnvmXCeCwMGetezW5o2X11OUnwN7-fb_jWPx6xyv ...
- in addition to 和 except for
except for 除了...以外(与 except for 连用的整体词与 except for 所跟的词往往不是同类的,是指整体中除去 一个细节.) eg:Your composition is ...
- (转)Ehcache 整合Spring 使用页面、对象缓存
Ehcache在很多项目中都出现过,用法也比较简单.一般的加些配置就可以了,而且Ehcache可以对页面.对象.数据进行缓存,同时支持集群/分布式缓存.如果整合Spring.Hibernate也非常的 ...
- Android -- startActivityForResult-------&&&----setResult
startActivityForResult与startActivity的不同之处 startActivity( ) 仅仅是跳转到目标页面,若是想跳回当前页面,则必须再使用一次startActivit ...
- elk深度解析
上面的两张图是elk的一个架构 下面是对logstash分析:如下图 可以看出 logstash的一个角色shipper,(是通过配置文件来决定logstash是shipper还是indexer)注意 ...