Is there a better way to write this code. It works fine but is extremely slow when processing large sets of data.
Function removeIllegalCharacters(name as string)
dim arrIllegal() as string = array ("\","/",":","?","<",">","*","“","&","@","$","|","%","~")
dim arrReplace() as string = array ("92","47","58","63","60","62","42","34","38","64","36","124","37","126")
dim i as integer
For i = 0 To 13
name = ReplaceAll(name,arrIllegal(i),"-chr" + arrReplace(i) + "-")
Next
return name
I have a similar function to put the same characters back (also too slow).