当前位置: 代码迷 >> 综合 >> 记录几个用到的字符串处理函数。
  详细解决方案

记录几个用到的字符串处理函数。

热度:14   发布时间:2024-01-16 08:23:38.0

 char *strtok(char s[], const char *delim); 功能 分解字符串为一组字符串。s为要分解的字符串,delim为 分隔符字符串。

string::size_type  find(string str, size_type pos)string变量的成员函数,pos为寻找的起始位置。 wei返回值为位置。

std::basic_stringbasic_string substr( size_type pos = 0, size_type count = npos );Returns a substring [pos, pos+count). 

find 与 substr结合起来用,来指定分隔符分割所有子串。

boost 库中实现了string.split


  相关解决方案