• 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: Best guess at expressing a string as a variable
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Best guess at expressing a string as a variable


  • Subject: Re: Best guess at expressing a string as a variable
  • From: Keary Suska <email@hidden>
  • Date: Tue, 22 Jan 2013 18:21:04 -0700

On Jan 22, 2013, at 4:28 PM, email@hidden wrote:

> I have a generic descriptive title of a parameter and want to express it as a variable name within a script.
>
> So if my title is "No more awesome today, please!" I will likely render this as "no-more-awesome-today-please" ( I can define the separator style).
>
> I am targeting about 20 or so scripting languages so the range of what each will deem is a valid variable name is rather wide.
> However I would like to deliver a reasonable default rendering.
>
> Dealing with English seems not too troublesome but titles composed in other languages might be a different matter.
>
> My current thinking is, regardless of the language, is to exclude all characters that are not members of NSCharacterSet + (id)letterCharacterSet.
>
> Is  + (id)letterCharacterSet the best choice here?

+ alphanumericCharacterSet might be a better choice, and you also want to consider case-sensitivity. If your application is handling all tokenization and interpretation then it doesn't really matter what do you as long as it is sufficiently tokenize-able.

HTH,

Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"


_______________________________________________

Cocoa-dev mailing list (email@hidden)

Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com

Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

References: 
 >Best guess at expressing a string as a variable (From: "email@hidden" <email@hidden>)

  • Prev by Date: Re: Best guess at expressing a string as a variable
  • Next by Date: Re: Best guess at expressing a string as a variable
  • Previous by thread: Re: Best guess at expressing a string as a variable
  • Next by thread: NSComboBox, binding, multiple selection, multiple values == trouble
  • Index(es):
    • Date
    • Thread