• 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: NSMutableString Exemplars
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSMutableString Exemplars


  • Subject: Re: NSMutableString Exemplars
  • From: Scott Anguish <email@hidden>
  • Date: Wed, 3 Dec 2003 01:03:31 -0500

On Dec 3, 2003, at 12:39 AM, Saul Iversen wrote:

Anyone have some good examples of how to manipulate NSMutableStrings? I'm looking for things like substring searching, parsing, and the like. Call me stupid but I can't seem to find anything in the Developer documentation that I am able to assimilate and make use of in a reasonable amount of time. If there is an obvious article beyond the link shown below please share it.

There are articles in that concept that cover searching, comparing, combining and extracting.
http://developer.apple.com/documentation/Cocoa/Conceptual/Strings/ index.html#//apple_ref/doc/uid/10000035i


Even if you could just type up a really simple example right here in a short period of time, that would be great. Show me how to create str2 out of the first X bytes of str1

Right from the doc

You can extract substrings from the beginning or end of a string to a particular index, or from a specific range, with thesubstringToIndex:, substringFromIndex:, and substringWithRange: methods. You can also split a string into substrings (based on a separator string) with the componentsSeparatedByString: method.


that'd be [str1 substringToIndex:x]

and the follow up by compressing str1 after removing those leading X bytes.

[str1 substringFromIndex:x+1]

If this question doesn't belong in this forum please forgive me.


It certainly is appropriate topic, but is covered by the doc you pointed at ("Combining and Extracting Strings")
_______________________________________________
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.
References: 
 >NSMutableString Exemplars (From: Saul Iversen <email@hidden>)

  • Prev by Date: NSMutableString Exemplars
  • Next by Date: Re: Notification System Woes
  • Previous by thread: NSMutableString Exemplars
  • Next by thread: Re: NSMutableString Exemplars
  • Index(es):
    • Date
    • Thread