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字符串的更多相关文章

  1. LoadRunner中常用的字符串操作函数

    LoadRunner中常用的字符串操作函数有:                strcpy(destination_string, source_string);               strc ...

  2. loadrunner中切割字符串

    下面函数的作用: http://blog.csdn.net/hgj125073/article/details/8447605 通过-与: 字符切割字符串,即-与:字符已经被\0 字符取代 char  ...

  3. LoadRunner中字符串的操作

    LoadRunner中字符串的操作 LoadRunner中常用的字符串操作函数有:                strcpy(destination_string, source_string); ...

  4. LoadRunner中截取字符串

    LoadRunner中截取字符串 /*strchr和strrchr的区别*/ char *strTest1="citms citms"; char *strTest2,*strTe ...

  5. shell 从变量中切割字符串

    1. 在shell变量中切割字符串 shell中截取字符串的方法有很多中,${expression}一共有9种使用方法.${parameter:-word}${parameter:=word}${pa ...

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

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

  7. 在LoadRunner中查找和替换字符串

    参考<Search & Replace function for LoadRunner>: http://ptfrontline.wordpress.com/2009/03/13/ ...

  8. LoadRunner中调用SHA1算法加密字符串

    参考<SHA-1 hash for LoadRunner>: http://ptfrontline.wordpress.com/2010/03/02/sha-1-hash-for-load ...

  9. LoadRunner中的Web 函数列表

    LoadRunner中的Web 函数列表 web test LoadRunner fuction_list D:\Program Files (x86)\Mercury Interactive\Mer ...

随机推荐

  1. a byte of python (摘01)

    a byte of python 第一章 介绍 Python 特色 简单.易学.免费.开源 高层语言.可移植性.解释性 面向对象.可扩展性.可嵌入性 丰富的库 第二章 安装Python http:// ...

  2. MST:Agri-Net(POJ 1258)

     Agri-Net 题目大意:农夫有一片农场,现在他要把这些田地用管子连起来,田地之间有一定距离,铺设每一段管子的长度与这些田地与田地距离是一样的,问你最小的铺设方案. 这一题很裸,Kruskal算法 ...

  3. codeforces 557B. Pasha and Tea 解题报告

    题目链接:http://codeforces.com/problemset/problem/557/B 题目意思:有 2n 个茶杯,规定第 i 个茶杯最多只能装 ai 毫升的水.现在给出 w 毫升的水 ...

  4. Struts 2, 值在验证失败回到原来页面的时候会丢失的解决方案

    比如,当我要添加一个信用卡的时候,我需要信用卡的CardType, 这些数据是存在数据库中的,我要先通过action 的一个 create方法,取到信用卡的类型: public String crea ...

  5. IOS 推送消息 php做推送服务端

    IOS推送消息是许多IOS应用都具备的功能,最近也在研究这个功能,参考了很多资料终于搞定了,下面就把步骤拿出来分享下: iOS消息推送的工作机制可以简单的用下图来概括: Provider是指某个iPh ...

  6. sql语句按照汉字拼音首字母排序

    oracle : 在oracle9i中新增了按照拼音.部首.笔画排序功能.设置NLS_SORT值SCHINESE_RADICAL_M 按照部首(第一顺序).笔划(第二顺序)排序SCHINESE_STR ...

  7. TFS强制解除签入签出锁定

    首先你要知道你服务器的用户名和登录密码 看被别人签出了的文件

  8. oc弹出框显示提示消息

    - (void)ShowHUDTitle:(NSString *)title andDelay:(NSTimeInterval)delayTime { if (HUD) { [HUD removeFr ...

  9. 启动Eclipse弹出:Failed to load JavaHL Library 错误框的解决办法

    一.问题背景描述: eclipse安装完svn插件以后,在启动时出现:Failed to load JavaHL Library.  These are the errors that were en ...

  10. swift枚举

    以下是指南针四个方向的一个例子:  enum CompassPoint { case North case South case East case West }   多个成员值可以出现在同一行上,用 ...