コード例 #1
0
ファイル: strutil_test.cpp プロジェクト: phantom9999/gingko
TEST(StrUtilTest, Ops) {
  string str("  Hello World ");
  StringTrimLeft(&str);
  EXPECT_EQ("Hello World ", str);
  StringTrimRight(&str);
  EXPECT_EQ("Hello World", str);
  StringToLower(&str);
  EXPECT_EQ("hello world", str);

  string str2("  Hello World ");
  StringTrim(&str2);
  EXPECT_EQ("Hello World", str2);
}
コード例 #2
0
ファイル: algorithm.cpp プロジェクト: 343829084/toft
std::string StringTrimLeft(const StringPiece& str, const StringPiece& trim_value)
{
    std::string res = str.as_string();
    StringTrimLeft(&res, trim_value);
    return res;
}
コード例 #3
0
ファイル: algorithm.cpp プロジェクト: 343829084/toft
std::string StringTrimLeft(const StringPiece& str)
{
    std::string res = str.as_string();
    StringTrimLeft(&res);
    return res;
}
コード例 #4
0
ファイル: StringUtil.cpp プロジェクト: sosoayaen/PokeBalloon
std::string StringUtil::StringTrim( const std::string& strContent )
{
	return StringTrimLeft(StringTrimRight(strContent));
}