Skip to content
Search
Advanced search
Quick links
Unanswered topics
Active topics
Search
The team
FAQ
Login
Register
Board index
Technologies技术
Profession职业
Search
C++ STL实现的string trim函数
Keep Open and Learning
Post Reply
Print view
Search
Advanced search
1 post • Page
1
of
1
星际浪子
Posts:
3597
Joined:
01 May 2009 23:45
C++ STL实现的string trim函数
Quote
Post
by
星际浪子
»
10 Jul 2011 15:30
std::string trim(string& s, const std::string& drop = " ")
{
// trim right
s.erase(s.find_last_not_of(drop)+1);
// trim left
return s.erase(0,s.find_first_not_of(drop));
}
Top
Post Reply
Print view
1 post • Page
1
of
1
Return to “Profession职业”
Jump to
Technologies技术
↳ Profession职业
LIFE生活
↳ Health健康
↳ UNDERSTANDING感悟