• 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: How to truncate NSStrings?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: How to truncate NSStrings?


  • Subject: Re: How to truncate NSStrings?
  • From: email@hidden (Simon Fraser)
  • Date: Wed, 24 Jul 2002 17:50:12 -0700

I'm quite familiar with [NSString substringWithRange]. That's not
what I'm asking. I want some truncation methods that:

i) can truncate based on measure string width, rather than number
of characters.

ii) are international-friendly (e.g. won't truncate in the middle
of a required ligature, and will insert an appropriate ellipsis).

Simon

Andrew Pinski wrote:
What about substringWithRange and what about reading the NSString docs first before asking on this list?

substringWithRange:

- (NSString *)substringWithRange:(NSRange)aRange

Returns a string object containing the characters of the receiver that lie within aRange. Raises an NSRangeException if any part of aRange lies beyond the end of the receiver.

See Also: - substringFromIndex:, - substringToIndex:


Thanks,
Andrew Pinski


On Wednesday, July 24, 2002, at 08:28 , Simon Fraser wrote:

How do I truncate an NSString in an international-friendly way?
I want something like the QuickDraw TruncString(), which takes
a param to truncate in the middle, or at the start or end.

In Appearance.h there is TruncateThemeText(), but that might
assume a QuickDraw drawing environment.

Simon
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.
_______________________________________________
cocoa-dev mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/cocoa-dev
Do not post admin requests to the list. They will be ignored.

  • Follow-Ups:
    • Re: How to truncate NSStrings?
      • From: Andy <email@hidden>
    • Re: How to truncate NSStrings?
      • From: Rosyna <email@hidden>
References: 
 >Re: How to truncate NSStrings? (From: Andrew Pinski <email@hidden>)

  • Prev by Date: What's wrong with this????
  • Next by Date: Re: What's wrong with this????
  • Previous by thread: Re: How to truncate NSStrings?
  • Next by thread: Re: How to truncate NSStrings?
  • Index(es):
    • Date
    • Thread