Searching whole string and deleting the character is a bit faster in my test.
on xClean(sString, sChar)
repeat with i = sString.length down to 1
if sString.char[i] = sChar then
delete sString.char[i]
end if
end repeat
return sString
end
_____
Buzz Kettles wrote:
> on clean str, aChar
> the itemDelimiter = aChar
> c = str.items.count
> newString = ""
> repeat with i = 1 to c
> newString = newString & str.item[i]
> end repeat
> return newString
> end
-- Test script
on xTest
sTest = "a" & QUOTE & "bc" & QUOTE & "def" & QUOTE & "ghij" & QUOTE & "klmno"
repeat with i = 1 to 10
sTest = sTest & sTest
end repeat
nStart = the ticks
clean(sTest, QUOTE)
put the ticks - nStart
nStart = the ticks
xClean(sTest, QUOTE)
put the ticks - nStart
end
Good luck,
Fumio Nonaka
Phone: +81-42-397-9452
Fax: +81-42-397-9452
mailto:[EMAIL PROTECTED]
http://www.FumioNonaka.com/
See also:http://www.F-site.org/
[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/lingo-l.cgi To post messages to the list, email
[EMAIL PROTECTED] (Problems, email [EMAIL PROTECTED]). Lingo-L is for
learning and helping with programming Lingo. Thanks!]