14 inline bool strip(std::string& a_string,
what a_type =
both,
char a_char =
' '){
17 std::string::size_type l = a_string.length();
18 if(l==0)
return false;
22 char* pos = (
char*)a_string.c_str();
23 for(std::string::size_type i=0;i<l;i++,pos++) {
25 a_string = a_string.substr(i,l-i);
26 return (i?
true:
false);
34 char* pos = (
char*)a_string.c_str();
36 std::string::size_type i = l-1;
37 std::string::const_reverse_iterator it;
38 for(it=a_string.rbegin();it!=a_string.rend();++it,i--,pos--) {
40 a_string = a_string.substr(0,i+1);
41 return (i==(l-1)?
false:
true);
51 if(stat_lead)
return true;
52 if(stat_trail)
return true;
59 #ifdef TOOLS_DEPRECATED
60 inline std::string strp(
const std::string& a_string,
what a_type =
both,
char a_char =
' '){
61 std::string s(a_string);
62 strip(s,a_type,a_char);
65 #endif //TOOLS_DEPRECATED
67 inline bool strip(std::vector<std::string>& a_strings,
what a_type =
both,
char a_char =
' ') {
68 bool some_done =
false;
69 std::vector<std::string>::iterator it;
70 for(it=a_strings.begin();it!=a_strings.end();++it) {
71 if(
strip(*it,a_type,a_char)) some_done =
true;