To download NI software, including the products shown below, visit ni.com/downloads.
1. Overview
This example lets the user escape and unescape a text of selected characters in order to reserve them in a string and automatically check the given list for duplicates.
2. Description
These VIs give you the ease to remove a given set of characters from the string, tag the removed characters, and output the escaped string. This is very useful for file formats were certain characters indicate, say, the end of a section. Also, you have the option of attaching a header containing unescaping instructions to the output string.
Escape Text.vi takes a string of text, then scans it for the characters listed in "Escape Characters" and replaces them with the "Escape Indicator" coupled with an unused character. This subvi would be used when you wanted to reserve special indicator characters, so this vi would allow you to reserve them. If you select "Implant Header" as TRUE, then the header detailing how to unescape the string is included in the "Escaped String" output.
Unescape Text.vi reverses the escaping process and restores the original text. You may input the characters that were escaped, as well as the escape indicator, or you may plug in the header that was outputted from Escape Text.vi. If neither terminals are wired, then the program assumes that the header is implanted and attempts to unescape using that.
3. Requirements
4. Steps to Implement or Execute Code
5. Additional Information or References
**The code for this example has been edited to meet the new Community Example Style Guidelines.**
Description-Separate-2Example code from the Example Code Exchange in the NI Community is licensed with the MIT license.