easyx_framework V1.0.0
基于easyx的c++游戏框架
 
载入中...
搜索中...
未找到
StrKit类 参考

字符串工具包. 更多...

#include <FileManager.h>

静态 Public 成员函数

static std::string Strcat (char const *str1, char const *str2,...)
 字符串拼接
 
static std::string & Trim (std::string &str)
 字符串修剪
 
static std::vector< std::string > Split (std::string const &str, std::string const &delim, int limit=0)
 字符串拆分
 

详细描述

字符串工具包.

成员函数说明

◆ Split()

std::vector< std::string > StrKit::Split ( std::string const & str,
std::string const & delim,
int limit = 0 )
static

字符串拆分

返回
被拆分出的子串向量
备注
以delim中的字符作为分隔符,对str字符串进行拆分,并对每个被拆分出的子串做修剪,拆分次数不超过limit,除非该参数的值为0
参数
[in]str待拆分字符串
[in]delim分隔符字符串
[in]limit拆分次数限制

◆ Strcat()

std::string StrKit::Strcat ( char const * str1,
char const * str2,
... )
static

字符串拼接

返回
拼接后的字符串
参数
[in]str1字符串1
[in]str2字符串2
[in]...字符串n

◆ Trim()

std::string & StrKit::Trim ( std::string & str)
static

字符串修剪

返回
被修剪过的参数字符串本身
备注
截去字符串的首尾空白字符(空格、制表、回车、换行等)
参数
str[in,out] 待修剪字符串