Re: NSString and NSScanner gurus
Re: NSString and NSScanner gurus
- Subject: Re: NSString and NSScanner gurus
- From: Sherm Pendley <email@hidden>
- Date: Wed, 26 Feb 2003 21:28:48 -0500
On Wednesday, February 26, 2003, at 08:08 PM, Umed Zokirov wrote:
How can I parse the result of /usr/bin/locate into an Array of
NSStrings. I would like to build up an array of paths returned by the
/usr/bin/locate utility. What arguments can I apply to my NSScanner or
NSString to extract individual pathnames from the output of
/usr/bin/locate? I don't exactly know the exact format of the output of
this function
Locate prints one pathname per line. Assuming you've already run locate,
and captured its output to an NSString named "myString", all you need to
do is split the string on newlines, like this:
NSArray *pathList = [myString componentsSeparatedByString: "\n"];
sherm--
UNIX: Where /sbin/init is Job 1.
_______________________________________________
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.