#include "chomp.h" std::string chomp ( const std::string& s ) { const char* p = &s[0]; const char* p2 = &s[0] + s.size(); std::string cr_lf = "\r\n"; while ( p2 > p && (cr_lf.find(p2[-1]) != std::string::npos) ) { p2--; } return std::string ( p, p2-p ); }
atwikiでよく見られているWikiのランキングです。新しい情報を発見してみよう!