Lib/Source/Pretty.cpp
/**
 * Split given string into first line and the rest.
 *
 * If there is no newline, put the entire string in `first`.
 */
Split given string into first line and the rest.
If there is no newline, put the entire string in `first`.
Split given string into first line and the rest . If there is no newline put the entire string in ` first ` .
void split_first_line(std::string const &in, std::string &first, std::string &rest) {
 auto pos = in.find("\n");
 if (pos == in.npos) {
   first = in;
   rest.clear();
 } else {
   first = in.substr(0, pos);  
   rest  = in.substr(pos + 1);
 }
}
void split_first_line ( std :: string const & in , std :: string & first , std :: string & rest ) { auto pos = in . find ( " \n " ) ; if ( pos == in . npos ) { first = in ; rest . clear ( ) ; } else { first = in . substr ( 0 , pos ) ; rest = in . substr ( pos + 1 ) ; } }
Split given string into first line and the rest.
Split given string into first line and the rest .
// No newline detected // This includes the newline