The current version of Trim Whitespace.vi uses regular expressions that are quite slow, but not needed since only simple search and a substring function is desired.
Therefore, I suggest to throw out the regex functions and replace them with G code looking for the same whitespaces (or even extend the selection to the openG variant).
I use the presented version within all my string processing functions, but many shipped VIs (especially the NI_LVConfig.lvlib) uses the trimming functions a lot. Since I do a lot of config files, this starts to be the bottleneck of the total LV code.
left-trim sub-VI:
right-trim sub-VI:
Performance metrics suggest speedup of about a factor of 15 for short strings and even more (>35) for longer strings.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.