Re: checking for characters
Re: checking for characters
- Subject: Re: checking for characters
- From: David Hood <email@hidden>
- Date: Wed, 10 Sep 2003 17:03:47 +1200
This will identify if there is at least one . in a string by checking
how many groups the string (excluding the first and last character)
will fall into if you divide the string up with .s
set testString to ".weird.case." -- example string
set newtest to (characters 2 through -2 of testString) as string
set AppleScript's text item delimiters to "."
set the listOftextitems to every text item of newtest
set numberOfparts to count of listOftextitems
set AppleScript's text item delimiters to ""
if numberOfparts = 1 then
--does not have . in middle
else
--has . in middle
end if
There can be anything before and after the .
David Hood
_______________________________________________
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.