As a suggestion it may actually be faster to use the replace function to replace any non alpha or non numerical chars in your str var.
str:= replace(str, '-','');
str:=replace(str,'/','');
etc.
and then you don't need to loop through your field.
As a suggestion it may actually be faster to use the replace function to replace any non alpha or non numerical chars in your str var.
str:= replace(str, '-','');
str:=replace(str,'/','');
etc.
and then you don't need to loop through your field.