Hi Guys,

On Fri, May 27, 2011 at 12:01 PM, Robert Osfield
<[email protected]> wrote:
> // Search in str for all occurences of spat and replace them with rpat.
> void searchAndReplace(std::string& str, const std::string& spat, const
> std::string& rpat)
> {
>    std::string::size_type pos = 0;
>    while ((pos = str.find(spat, pos)) != std::string::npos)
>    {
>        str.replace(pos, spat.length(), rpat);
>        pos += rpat.length();
>    }
> }
>
> Does this look sensible?  If so I'll merge this.

Got impatient, I think the code is fine so I've gone ahead and checked it in.

Robert.
_______________________________________________
osg-submissions mailing list
[email protected]
http://lists.openscenegraph.org/listinfo.cgi/osg-submissions-openscenegraph.org

Reply via email to