All pastes #57710 Raw Edit

Something

public cpp v1 · immutable
#57710 ·published 2006-05-21 19:35 UTC
rendered paste body
#include <cctype>#include <algorithm>#include <locale>class to_lower{	public:		char operator() (char c) const        // notice the return type	        {		        return tolower(c);		}};------------------------------------------------string repl, key, get, temp;temp = result;std::transform(temp.begin(), temp.end(), temp.begin(), to_lower());loc = temp.find( key, 0 );while (loc != string::npos) {        result.replace( loc, key.length(), repl );        loc = result.find( key, 0 );}replace.erase(replace.begin());