TF++, Miscellaneous classes and modules in C++:

◆ trimws_begin()

std::string tfxx::string::trimws_begin ( std::string  s)

function #tf::trimws_begin#: Erase leading whitespace from a string.

Returns
string with leading whitespace removed
Parameters
sstring to remove leading whitespace from
Author
Thomas Forbriger
Version
V1.0 (#$Revision: 1.4 $
Date
2009-11-11 12:34:04

#) remove leading whitespace

See also
trimws_end
trimws

Definition at line 74 of file stringfunc.cc.

75  {
76  if (s.length()>0)
77  {
78  std::string::size_type ib=s.find_first_not_of(" ", 0);
79  if (ib==std::string::npos)
80  {
81  s="";
82  }
83  else if (ib!=0)
84  {
85  std::string::size_type n=s.length()-ib;
86  s=s.substr(ib,n);
87  }
88  }
89  return(s);
90  } // std::string trimws_begin(std::string s)