freeswitch函数之switch_separate_string字符串分割
2017-01-07 15:47
393 查看
switch_separate_string
switch_separate_string_string(char *buf, char *delim, _Post_count_(return) char **array, unsigned int arraylen);
完成split的功能
使用示例:
switch_separate_string_string(char *buf, char *delim, _Post_count_(return) char **array, unsigned int arraylen);
完成split的功能
使用示例:
char *params = "param_1=p1,param_2=p2,param_3=p3"; //要获取到每一个param,就要将params用逗号分割 char *param_tmp = strdup(params); char *param_array[10] = { 0 }; int p_index = 0; int param_size = switch_separate_string(param_tmp ,',',param_array,(sizeof(param_array) / sizeof(param_array[0]))); for(p_index = 0; p_index < param_size; p_index ++) { switch_log_printf(SWITCH_CHANNEL_LOG,SWITCH_LOG_NOTICE,"---[%s]---\n",param_array[p_index]); }
相关文章推荐
- PHP - Manual手册 - 函数参考 - String 字符串处理函数 - explode使用一个字符串分割另一个字符串
- [C 语言]将一字符串分割,并将结果保存到数组里面 separate_string_to_array
- [寒江孤叶丶的Cocos2d-x之旅_20]Lua字符串分割函数分享,Lua StringSplit
- C++ String switch遇到的问题 string字符串split分割
- AfxExtractSubString分割字符串的函数
- Delphi分割字符串的函数
- PHP - Manual手册 - CLXI. String 字符串处理函数 - substr返回字符串中的一部分
- 重写string.h中的字符串操作函数--strncat
- PHP - Manual手册 - CLXI. String 字符串处理函数 - str_replace用替换字符串替换所有出现的搜索字符串
- PHP - Manual手册 - CLXI. String 字符串处理函数 - str_pad使用另一个字符串将一个字符串填充到指定长度
- vc分割字符串的函数
- 重写string.h中的字符串操作函数--strncpy
- DELPHI字符串分割函数
- Delphi中的一些字符串分割的函数收集
- Delphi分割字符串的函数
- PHP - Manual手册 - CLXI. String 字符串处理函数 - strpos查找一个字符串第一次出现的位置
- 用空格分割字符串的函数
- SQL Serve中实现字符串分割(split)的功能函数
- 重写string.h中的字符串操作函数--strcpy
- string,token,字符串分割,分隔符