Buzz's script will be faster if the character to find is contained few
in a string, though.
-- 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, "
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,
oops (resend) - I typed the Lingo too quickly & didn't test it -
-
you can also clean a char out by chunking through the items
if a field(1) holds this:
From: "Jayp" <[EMAIL PROTECTED]>
To: "TomH" <[EMAIL PROTECTED]>
etc.
you can c
you can also clean a char out by chunking through the items
if a field(1) holds this:
From: "Jayp" <[EMAIL PROTECTED]>
To: "TomH" <[EMAIL PROTECTED]>
etc.
you can clean out the quotes (or any specific character) by calling
member(1).text = clean(member(1).text, QUOTE)
on clean (str, char)
Jayp,
> How can I tell if there is a QUOTE in my variable an delete it
>
> Theres a quote in my LIST and its making the list NOT work properly
>
> Ie. "From: "Jayp" <[EMAIL PROTECTED]>"
>
> See the quotes around JAYP
> I need to get rid of them
The trick is to use the offset method in Lin
numchars = varName.chars.count
repeat with eachchar = numchars down to 1
if varname.char[eachchar] = QUOTE then
delete char eachchar of varname
end if
end repeat
something like that.
(you have to loop backwards, because if you don't, when you delete
characters, you'll mess up t