• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Comparing for case difference
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Comparing for case difference


  • Subject: Comparing for case difference
  • From: Laine Lee <email@hidden>
  • Date: Wed, 18 Dec 2002 13:58:46 -0600

I have this script that checks for case difference between two strings, but
if the strings are very long, this can really eat up time.

Can you give me something better for comparing long strings for case
difference? Thanks.

set a to "jeremiah"
set b to "jeremiaH"

Checkchange(a, b)

on Checkchange(x_string, y_string)
set mychanged to false
repeat with this_char in x_string
set myitem to (offset of this_char in y_string)
try
get (item myitem of y_string)
on error
set mychanged to true
exit repeat
end try
end repeat
if not mychanged then
display dialog "Same!" buttons {"OK"} default button 1
else
display dialog "Different!" buttons {"OK"} default button 1
end if
end Checkchange

--
Laine Lee
email@hidden
http://www.txdirect.net/users/llee
_______________________________________________
applescript-users mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/applescript-users
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: Comparing for case difference
      • From: Ben Waldie (AppleScript Guru) <email@hidden>
  • Prev by Date: Re: BIG number as string
  • Next by Date: Re: Reading nested key-value pairs in plist
  • Previous by thread: RE: Handy conversion handler?
  • Next by thread: Re: Comparing for case difference
  • Index(es):
    • Date
    • Thread