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 ...
随机推荐
- apache官网怎样下载apache HTTP Server服务器
我相信有些朋友刚用apache服务器时,都希望从官网上下载,而面对着官网上众多的项目和镜像以及目录,也许有点茫然.下面是具体步骤 第一步:打开apache官网 第二步:点击右上角Download,出现 ...
- ffmpeg-20160816-bin.7z
ESC 退出 0 进度条开关 1 屏幕原始大小 2 屏幕1/2大小 3 屏幕1/3大小 4 屏幕1/4大小 S 下一帧 [ -2秒 ] +2秒 ; -1秒 ' +1秒 下一个帧 -> -5秒 f ...
- Effective C++ -----条款18:让接口容易被正确使用,不易被误用
好的接口很容易被正确使用,不容易被误用.你应该在你IDE所有接口中努力达成这些性质. “促进正确使用”的办法包括接口的一致性,以及与内置类型的行为兼容. “阻止误用"的办法包括建立新类型.限 ...
- 【python】词法语法解析模块ply
官方手册:http://www.dabeaz.com/ply/ply.html 以下例子都来自官方手册: 以四则运算为例: x = 3 + 42 * (s - t) 词法分析: 需要将其分解为: 'x ...
- August 22nd 2016 Week 35th Monday
Have you ever given any thought to your future? 你有没有为将来打算过呢? Have you ever given any thought to your ...
- cuda 初学大全
转自:http://blog.csdn.net/augusdi/article/details/12529331 cuda 初学大全 1 硬件架构CUDA编程中,习惯称CPU为Host,GPU为Dev ...
- 解决window删除文件时提示: 源文件名长度大于系统支持的长度
import java.io.File; /** */ public class DeleteFiles { public static void deleteFiles( File file ){ ...
- 一个TextView内显示不同颜色的文字
String format = "<font color='#FC8262'>%s</font>:%s"; String text = String.for ...
- ASP.NET MVC 伪静态的实现
public class RouteConfig { public static void RegisterRoutes(RouteCollection routes) { routes.Ignore ...
- 关于python性能提升的一些方案(上)
一.函数调用优化(空间跨度,避免访问内存) 1.大数据求和,使用sum a = range(100000) %timeit -n 10 sum(a) 10 loops, best of 3: 3.15 ...