10-29-2009 09:28 AM
Another one of those personal subVI assassins today, "Search and Replace String". One of my utility subVIs that had been sticking around removes whitespace from strings. "Trim Whitespace.vi" came along, but it only removes whitespace from the ends (and a limited subset of whitespace at that). With strategically chosen search strings, today's function can perform this task quite effectively. Make sure you choose 'Regular Expression' from the right-click menu when you use it. Now here is all it takes to start cleaning up those dirty strings.
VIOTD groundrules here.
10-29-2009 09:35 AM
10-29-2009 10:00 AM
smercurio_fc wrote:
You can also use that function for cheating. I've used it, for example, to count how many lines are in a string by replacing all EOL characters with some other character and looking at the "number of replacements" output. An alternative to converting the string to an array and then getting the array size.
If that is considered cheating, then I propose a change to the rulebook. No, wait, breaking the rules is much more fun.