REPLACE
Splices a string into the specified string, replacing the characters in the original string from a range of characters.
Syntax
=REPLACE(string, start, count, replacement)
Arguments
Argument | Type | Description |
---|---|---|
string | String | The specified string |
start | Number | The index of the specified string in which to start the replacement |
count | Number | The number of characters to replace |
replacement | String | The string to splice into the specified string |
Start is 1-based (i.e. an index of 1 is used for the first character).
Examples
=REPLACE("Hello!", 6, 0, " world")
→"Hello world!"
At the start index of 6, between "o" and "!", insert the string " world"
=REPLACE("Hello world!", 7, 6, "there")
→"Hello there"
At the start index of 7, between " " and "w", replace the next 6 characters with the string "there"
Updated 7 months ago