stringtokenizer.h

来自「该源码是一个比较经典的字符串处理函数」· C头文件 代码 · 共 53 行

H
53
字号
/* *********************************************************************** * Class: StringTokenizer                                              * * By Arash Partow - 2000                                              * * URL: http://www.partow.net/programming/stringtokenizer/index.html   * *                                                                     * * Copyright Notice:                                                   * * Free use of this library is permitted under the guidelines and      * * in accordance with the most current version of the Common Public    * * License.                                                            * * http://www.opensource.org/licenses/cpl.php                          * *                                                                     * ************************************************************************/#ifndef INCLUDE_STRINGTOKENIZER_H#define INCLUDE_STRINGTOKENIZER_H#include <stdio.h>#include <stdlib.h>#include <iostream>#include <string>class StringTokenizer{   public:    StringTokenizer(const std::string& _str, const std::string& _delim);   ~StringTokenizer(){};    int         countTokens();    bool        hasMoreTokens();    std::string nextToken();    int         nextIntToken();    double      nextFloatToken();    std::string nextToken(const std::string& delim);    std::string remainingString();    std::string filterNextToken(const std::string& filterStr);   private:    std::string  token_str;    std::string  delim;};#endif

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?