filtering non-alphanumeric chars in processing

Bruce Easton bruce at stn.com
Thu Feb 26 10:03:35 PST 2015


I need to filter out (squish out) non-alphanumeric characters from small 
array-element strings in processing for a large amount of data.

Since I am already having to, for other purposes form each string 
character by character, I'm wondering which might be more efficient at 
runtime (or if there would even be any noticeable difference).

For each character, I could test its inclusion in the desired ascii 
range using the asc() function;
or for each, I could set an "okstring" to "0123...9abc...z" and then 
test if the char is contained in said okstring;
or for each, I could apply the char to a dummy with the alnum edit and 
then test if the dummy is left blank.

Just wondering out loud.  I haven't tried any of these against a large 
data set - but ultimately this will be used for such, so I should soon 
know.  I have a feeling testing against the edit result might be the 
most efficient.

Bruce



More information about the Filepro-list mailing list