function replace( str, search, newval ) {
	return str.replace( search, newval );
}
Replaces search occurrences with a replacement string.

@param {string} str - input string
@param {RegExp} search - search expression
@param {(string|Function)} newval - replacement value or function
@returns {string} new string containing replacement(s)

@example
var str = 'Hello World';
var out = replace( str, /world/i, 'Mr. President' );
// returns 'Hello Mr. President'

@example
var capitalize = require( '@stdlib/string/base/capitalize' );

var str = 'Oranges and lemons say the bells of St. Clement\'s';

function replacer( match, p1 ) {
    return capitalize( p1 );
}

var out = replace( str, /([^\s]*)/gi, replacer );
// returns 'Oranges And Lemons Say The Bells Of St. Clement\'s'