Re: Stripping newlines/blanks when pasting on an NSTextField
Re: Stripping newlines/blanks when pasting on an NSTextField
- Subject: Re: Stripping newlines/blanks when pasting on an NSTextField
- From: "I. Savant" <email@hidden>
- Date: Sat, 28 Oct 2006 17:44:35 -0400
Ah, you're absolutely right - my eyes were drawn directly to the
character set and I failed to see the forest for the trees.
I'm still seeing a problem, though: You're trimming only the ends,
but what about the middle? What if the user copies a few paragraphs
from a text editor and pastes it here?
--
I.S.
On Oct 28, 2006, at 5:34 PM, Rosyna wrote:
Only at the ends.
"
Bob's your uncle. "
Becomes:
"Bob's your uncle."
That's what the "trim" is doing.
Ack, at 10/28/06, I. Savant said:
On Oct 28, 2006, at 5:05 PM, Rosyna wrote:
Try performing stringByTrimmingCharactersInSet:[NSCharacterSet
whitespaceAndNewlineCharacterSet] on the string.
+whitespaceAndNewlineCharacterSet removes spaces too. ;-)
--
Sincerely,
Rosyna Keller
Technical Support/Carbon troll/Always needs a hug
Unsanity: Unsane Tools for Insanely Great People
It's either this, or imagining Phil Schiller in a thong.
_______________________________________________
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