src/miscelania.cpp
// cut-off the extension from the input filename.
cut-off the extension from the input filename.
cut - off the extension from the input filename .
std::string strip_extension(std::string fname) {
  int i;
  std::string ret;
  for(i=fname.size()-1; i>= 0; i--) {
    if (fname[i] == '.') break;
  }
  if (i<= 0) ret = fname;
  else ret.assign(fname, 0, i);
  return ret;
}
std :: string strip_extension ( std :: string fname ) { int i ; std :: string ret ; for ( i = fname . size ( ) - 1 ; i >= 0 ; i -- ) { if ( fname [ i ] == ' ' ) break ; } if ( i <= 0 ) ret = fname ; else ret . assign ( fname , 0 , i ) ; return ret ; }
cut-off the extension from the input filename.
cut - off the extension from the input filename .