tst wrote:
I never thought I would live to see the day where Altenbach suggests a loop (with a resizing operation, no less) as the simpler solution to a single primitive. :smileyvery-happy:
Hey!!! :D
Yes, the loop can be done essentially in-place by re-using the input array with a little bit more code. Yes, the primitive is probably a more natural choice, but it requires fancy knowledge to compose the pattern string. ;)
The purpose of my post was more educational to draw attention to the "lexical class" primitive. Most people have never seen it. :) It can be useful.
Performance wise, the "search and replace all" is a multipurpose VI and the parsing and matching is probably more expensive than the lexical class, which could be implemented as a simple 8bit lookup table. I have not done any benchmarks though. :)