Replacing Text in a String at a Specified Point

Complete the following steps to replace text in a string.

  1. Add the Replace Substring function to the block diagram.

     Add  Find
  2. Wire the string in which you want to replace text to the string input of the Replace Substring function.
  3. Wire the string containing the replacement text to the substring input of the Replace Substring function.
  4. In the offset input of the Replace Substring function, enter the number of characters into string where you want to start replacing text. For example, to start replacing text after the fifth character in string, enter 5 in offset.
  5. Wire the result string output of the Replace Substring function to a string indicator or VI or function that accepts a string as an input.
  6. Run the VI. The replaced substring output of the Replace Substring function returns the text you replaced.

You also can search for and replace text in a string.