• 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
Re: Detecting the minus sign in a string
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Detecting the minus sign in a string


  • Subject: Re: Detecting the minus sign in a string
  • From: KOENIG Yvan <email@hidden>
  • Date: Wed, 23 Jun 2010 20:14:29 +0200


Le 23 juin 2010 à 19:41, Luther Fuller a écrit :

On Jun 23, 2010, at 12:15 PM, Alex Zavatone wrote:

I just found out that if you have a string with a minus sign in it, that the minus sign can not be a word.

The string,
"This is my - string"

simply ignores the minus sign as a word.
Any ideas on how to detect the minus sign?  Offset maybe?

On the other hand, there's ...

set x to "This is my - string"
set AppleScript's text item delimiters to {space}
text items of x --> {"This", "is", "my", "-", "string"}


As tha minus char may be adjacent to an other char, my own choice would be :

set x to "This is my-string"
set AppleScript's text item delimiters to {"-"}
set maybe to text items of x --> {"This is my",  "string"}

so,count of maybe - 1 is the count of minus characters

Yvan KOENIG (VALLAURIS, France) mercredi 23 juin 2010 20:14:22



_______________________________________________
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
References: 
 >Detecting the minus sign in a string (From: Alex Zavatone <email@hidden>)
 >Re: Detecting the minus sign in a string (From: Luther Fuller <email@hidden>)

  • Prev by Date: Re: Detecting the minus sign in a string
  • Next by Date: *** OUT ***AppleScript-Users Digest, Vol 7, Issue 331
  • Previous by thread: Re: Detecting the minus sign in a string
  • Next by thread: Re: Detecting the minus sign in a string
  • Index(es):
    • Date
    • Thread