Replaces all instances of a substring with another substring.
A Boolean value that determines whether to treat the text in the input string as a multiple-line string. This affects how the ^ and $ characters handle matches.
True | ^ matches the beginning of any line in the input string. $ matches the end of any line in the input string. |
False | ^ matches only the beginning of the input string. $ matches only the end of the input string. |
Default: False
The string this node searches.
The string you want to replace if it exists in the input string.
Implications of Empty String
If search string is an empty string and replace all is False, the node inserts replace string at the beginning of input string. If search string is an empty string and replace all is True, the node inserts replace string at the beginning of input string, in between each character, and at the end.
The string used to replace search string in input string.
Default: Empty string
The number of characters into the input string at which this node starts searching.
The offset of the first character in the input string is 0. If offset is beyond the end of the input string, this node returns an empty string.
Error conditions that occur before this node runs.
The node responds to this input according to standard error behavior.
Standard Error Behavior
Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.
Default: No error
The input string with one or all occurrences of search string replaced with replace string.
If replace string is empty, result string contains input string with search string deleted.
Number of times this node replaced search string.
The offset of the character immediately following where the last match and replacement occurred in the result string.
If the node does not find the search string, this output is -1.
If replace all is False, the next match, if any, is after this point.
Error information.
The node produces this output according to standard error behavior.
Standard Error Behavior
Many nodes provide an error in input and an error out output so that the node can respond to and communicate errors that occur while code is running. The value of error in specifies whether an error occurred before the node runs. Most nodes respond to values of error in in a standard, predictable way.
If you want to search for complex patterns, like 5-character substrings ending with d, configure this node to search using regular expressions. Select Regular Expression in the Behavior section of the Item tab. This enables you to search for matches using regular expressions in the search string input.
You can also use the Match Regular Expression node instead, which uses the same regular expression syntax.
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.
Where This Node Can Run:
Desktop OS: Windows
FPGA: All devices (only within an optimized FPGA VI)
Web Server: Not supported in VIs that run in a web application