常用c函数收集
来源:互联网 发布:中京现货交易软件 编辑:程序博客网 时间:2024/05/17 07:41
1 strstr:
The strstr() function finds the first occurrence of the substring needle in the string haystack. The terminating null bytes ('\0') are not compared.
The strcasestr() function is like strstr(), but ignores the case of both arguments.
在串中查找指定字符串的第一次出现
2 strtok:
The strtok() function breaks a string into a sequence of zero or more nonempty tokens. On the first call to strtok() the string to be parsed should be specified in
str. In each subsequent call that should parse the same string, str must be NULL.
用于在一个字符串中遍历查找子串
例子:
#include <string .h>int main(int argc, char* argv[]){ char *p=NULL; char str[] ="123,4567,8,9,01,44"; const char * split = ","; p = strtok (str,split); while(p!=NULL) { printf ("%s %d\n",p,strlen(p)); p = strtok(NULL,split); } return 0;}
3 setlocale:
设置程序执行的编码环境,会影响字符串长度的计算(比如中文字符串的长度)
- 常用c函数收集
- C#.NET常用函数和方法集(收集收藏)
- 数据库常用函数收集
- 常用PHP函数收集
- 常用js函数收集
- 常用js函数收集
- 常用js函数收集
- VC常用函数收集
- 常用函数收集
- php 常用函数收集
- java常用函数收集
- erlang常用函数收集
- 常用公共函数收集
- PHP常用函数收集
- PHP常用函数(收集)
- python 常用函数收集
- js 常用函数收集
- C#.NET函数 收集
- QT Embedded二三事之QObject
- The Struts dispatcher cannot be found in struts2
- 计算机视觉领域的一些牛人博客,超有实力的研究机构等的网站链接
- 方框中打钩
- Android listView使用Adapter.notifyDataSetChanged()不刷新
- 常用c函数收集
- 使用JMeter进行性能测试(Java请求)
- java transient简介
- Android pm命令及使用
- Struts2 校验框架学习笔记
- ios中关于使用arc,并且使用了ASIhttp请求较多发生崩溃问题的解决
- Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:]
- 如何利用appserver在本机搭建WordPress服务器
- Oracle sqlplus/as sysdba命令详解