‘Simple function, save yourself the trouble!
function formatSTRING(strSTRING)
Dim iPos, strNewSTRING, iTemp
strSTRING = Trim(strSTRING)
if strSTRING <> "" then
iPos = 1
iTemp = Len(strSTRING)
While iTemp >= iPos
If Mid(strSTRING,iPos,1) = Mid(strSTRING,iPos,1) Then
if cint(asc(Mid(strSTRING,iPos,1)))
< 65 or _
cint(asc(Mid(strSTRING,iPos,1)))
> 122 or _
instr(Mid(strSTRING,iPos,1),
"^") or _
instr(Mid(strSTRING,iPos,1),
"'") or _
instr(Mid(strSTRING,iPos,1),
"\") or _
instr(Mid(strSTRING,iPos,1),
"[") or _
instr(Mid(strSTRING,iPos,1),
"]") then
strNewSTRING =
strNewSTRING & ""
else
strNewSTRING = strNewSTRING
& Mid(strSTRING,iPos,1)
end if
End If
iPos = iPos + 1
Wend
Else
strNewSTRING = ""
end if
formatSTRING = strNewSTRING
end function
|