Replace Substring
- Updated2023-02-17
- 2 minute(s) read
Replace Substring
Deletes a specified length of characters in a string and replaces the deleted portion with another string.
Inputs/Outputs

string
The string in which you want to replace characters.

substring
Substring that replaces a specified length of characters in the input string.
Default value: Empty string

offset
The number of characters into the string at which the node places the substring.
Default value: 0

length
The number of characters the substring will replace in the input string.
If the substring is empty, the specified length of characters is deleted starting at the offset.
Default value: 0

result string
The edited string that includes the replaced characters.

replaced substring
Characters that were replaced in the string.
Reducing Performance Burden
Characters in UTF-8 can be multiple bytes so string nodes count the number of characters in a string instead of jumping to a point in memory. Since the length and offset parameters are in units of characters, avoid nesting this node with large strings because that can create exponential functions that carry a higher performance burden.