Re: TIDs case insensitive?
Re: TIDs case insensitive?
- Subject: Re: TIDs case insensitive?
- From: Richard 23 <email@hidden>
- Date: Wed, 7 Mar 2001 02:24:47 -0800
>
Hi all,
>
>
I just found to my great dispair that TIDs are case sensitive. Is there a
>
way to make them insensitive? - no, not ignoring case, I just tried...
>
I use TIDs for fast substring replacements. If I cant' make them case
>
insensitive, I will have to use more traditional and less efficient
>
search/replace.
>
Serge Belleudy-d'Espinose
Wow a post about AppleScript. How unique! ;)
If I don't care about case I'll change a copy of the text to lowercase.
The case of extracted strings can be preserved of course by performing
comparisons on the lowercase version but extracting substrings for output
from the original.... I too was saddened by this achilles heel of the
tids.
-- ---------------------------------------------------------
-- Preprocessed by Convert Script 1.0d5
-- ---------------------------------------------------------
-- author: Richard 23, date: Wednesday, March 7, 2001
-- ---------------------------------------------------------
on ToLower(theStr)
set theStr to theStr as string
repeat with thePos from 1 to 26
if theStr contains ABC's character thePos then
set {AppleScript's text item delimiters} to ==>
{ABC's character thePos}
set {AppleScript's text item delimiters} to ==>
{xyz's character thePos, theStr's text items}
set {AppleScript's text item delimiters, theStr} to ==>
{"", result's end as string}
end if
end repeat
return theStr
end ToLower
-- ---------------------------------------------------------
R23