replace [C++ Reference]
Keywords: stl,algorithm,replace
Date: 2009-10-09T01:17:15-0700

[[replace]]
C++ Reference
Translations of this page?:

- en
- br-pt
- cn
- cz
- de
- es
- fr
- it
- jp
- nl
- pl
- ro
- ru
- sk
- tr
- tw

## replace

Syntax:

        #include <algorithm>
        void replace( forward_iterator start, forward_iterator end, const TYPE& old_value, const TYPE& new_value );

The replace() function sets every element in the range [start,end) that is equal to old_value to have new_value instead.

replace() runs in linear time.

Related Topics: replace_copy, replace_copy_if, replace_if

Edit this page • Old revisions
• • • Login • Index • Recent changes • RSS • cc •