Re: Is there the equivalent of "any item of"
Re: Is there the equivalent of "any item of"
- Subject: Re: Is there the equivalent of "any item of"
- From: Joe <email@hidden>
- Date: Fri, 18 Apr 2008 10:37:37 -0700
>Let's say I have a string I want to check for any one of several substrings.
>
>Is there a way to do something like this:
>
> set stringToSearch to "I have a brand new pair of rollerskates"
> if stringToSearch contains any item of {"new","rollerblade} then
> -- at least one item from the list was found
> end if
>
>I know you can iterate through the list with repeat, I was just wondering about a concise way to do it.
set stringToSearch to "I have a brand new pair of rollerskates"
if "new" is in stringToSearch or "rollerskates" is in stringToSearch then
display dialog "True"
end if
Joe
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden