• 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: Finding next / previous characters in an alphabet?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Finding next / previous characters in an alphabet?


  • Subject: Re: Finding next / previous characters in an alphabet?
  • From: Jonathan del Strother <email@hidden>
  • Date: Sun, 21 Aug 2005 01:22:21 +0100

Mmm, I appreciate that, but I'd be content following whatever order the Finder would lay them out in if they were filenames.

I have a collection of album titles in alphabetical order, and want to be able to jump to the next letter up or down. One way of doing this would be to carry on walking through the album list until the first character changes, but things would be far neater if I had a 'nextCharacter' function...


On 21 Aug 2005, at 00:20, John Stiles wrote:

Just out of curiosity, what is your ultimate goal here?

I don't think it's clear that all characters have an obvious "next" character. You mention Japanese, so I'll use Kanji as my example-- certainly they have an ordering, in that they all have Unicode codepoints, but I don't think it's an average user would think of them as "ordered" per se. To put it in other terms--from the perspective of Unicode, 樸 (codepoint 6A38) is immediately followed by 樹 (codepoint 6A39). But if you asked a Japanese person "what character is the next Kanji immediately after 樸", the question doesn't make any sense. They wouldn't say, "oh, 樹!"


Jonathan del Strother wrote:


I have a unicode character in an NSString. I need to find the next character in the alphabet - eg if I have 'd', I want 'e'. I'd also like it to work with (for example) japanese characters.

There's clearly some character-ordering somewhere in Cocoa, since it must use that for the compare: methods, but I can't figure out how to get to it. Any suggestions?

Jon
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
40blizzard.com


This email sent to email@hidden




_______________________________________________ Do not post admin requests to the list. They will be ignored. Cocoa-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
References: 
 >Finding next / previous characters in an alphabet? (From: Jonathan del Strother <email@hidden>)
 >Re: Finding next / previous characters in an alphabet? (From: John Stiles <email@hidden>)

  • Prev by Date: Printing an NSOpenGLView
  • Next by Date: How to draw a 1 pixel bezierPath
  • Previous by thread: Re: Finding next / previous characters in an alphabet?
  • Next by thread: Printing an NSOpenGLView
  • Index(es):
    • Date
    • Thread