sqlines-w/str.cpp
// Replace the first occurrence of a substring
Replace the first occurrence of a substring
Replace the first occurrence of a substring
void Str::ReplaceFirst(std::string &str, std::string what, std::string with)
{
	int pos = str.find(what, 0);
	if(pos != std::string::npos)
		str.replace(pos, what.size(), with);
}
void Str :: ReplaceFirst ( std :: string & str , std :: string what , std :: string with ) { int pos = str . find ( what , 0 ) ; if ( pos != std :: string :: npos ) str . replace ( pos , what . size ( ) , with ) ; }
Replace the first occurrence of a substring
Replace the first occurrence of a substring
// Find the substring starting from the first position of the original string