36 #define TF_STRINGFUNC_CC_VERSION \ 37 "TF_STRINGFUNC_CC V1.1" 39 #include <tfxx/stringfunc.h> 55 std::string::size_type ib=s.find_first_not_of(
" ", 0);
56 if (ib==std::string::npos)
62 std::string::size_type il=s.find_last_not_of(
" \r", s.length());
63 std::string::size_type n=il>=ib ? il-ib+1 : 0;
65 if ((ib!=0) || (n!=s.length())) { s=s.substr(ib,n); }
78 std::string::size_type ib=s.find_first_not_of(
" ", 0);
79 if (ib==std::string::npos)
85 std::string::size_type n=s.length()-ib;
105 std::string::size_type il=s.find_last_not_of(
" \r", s.length());
106 std::string::size_type n=il>=0 ? il+1 : 0;
107 if (n!=s.length()) { s=s.substr(0,n); }
122 std::string::size_type i=s.find(delim);
124 if ((i>=0) && (i<s.size())) {
125 result=s.substr(0,i);
145 for (std::string::const_iterator i=s.begin(); i!=s.end(); i++)
146 {
if (*i == c) { result++; } }
161 const std::string& p,
162 const std::string& r)
164 std::string retval=s;
165 std::string::size_type n=retval.find(p);
166 while (n !=std::string::npos)
168 retval.replace(n,p.length(),r);
std::string trimws(std::string s)
std::string strip_string(std::string &s, const char &delim)
std::string patsubst(const std::string &s, const std::string &p, const std::string &r)
std::string trimws_begin(std::string s)
std::string trimws_end(std::string s)
int count_char(const std::string &s, const char &c)
Namespace containing all code of library libtfxx.