| There is no RationalWiki without you. We are a small non-profit with no staff – we are hundreds of volunteers who document pseudoscience and crankery around the world every day. We will never allow ads because we must remain independent. We cannot rely on big donors with corresponding big agendas. We are not the largest website around, but we believe we play an important role in defending truth and objectivity. If everyone who saw this today donated $5, we would meet our goal for 2019. |
Fighting pseudoscience isn't free. We are 100% user-supported! Help and donate $5, $20 or whatever you can today with |
User talk:Concernedresident/assquotesource
assuming you're not going to have any words over LINELENGTH characters, I think this would work:
void wrapPrint (string assquote) {
int i = LINELENGTH;
if (assquote.length() > LINELENGTH) {
for(;assquote[i] != ' ' && i > 0; i--);
cout << assquote.substr(0,i) << endl;
wrapPrint(assquote.substr(++i, assquote.length()-i));
}
else cout << assquote << endl;
}
— Sincerely, Neveruse / Talk / Block 17:55, 13 May 2010 (UTC)
Alternatively, with the same assumption:
string wrapString (string assquote) {
int i = LINELENGTH;
if(assquote.length() > LINELENGTH) while(assquote[i] != ' ' && i > 0) i--;
return assquote.substr(0,i-(assquote.length()>LINELENGTH)) + '\n' + (assquote.length() > i ? wrapString(assquote.substr(++i, assquote.length()-i)) : "");
}
— Sincerely, Neveruse / Talk / Block 18:11, 13 May 2010 (UTC)