Fortran SFF API to data I/O streams in C++

◆ trimws_end()

std::string fapidxx::trimws_end ( std::string  s)

remove whitespace at end of string

Definition at line 105 of file helper.cc.

Referenced by stringfromfstring().

106  {
107  if (s.length()>0)
108  {
109  string::size_type il=s.find_last_not_of(" \r", s.length());
110  string::size_type n=il>=0 ? il+1 : 0;
111  if (n!=s.length()) { s=s.substr(0,n); }
112  }
113  return(s);
114  } // std::string trimws_end(std::string s)
Here is the caller graph for this function: