[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Preserving newlines
From: |
Chris Vetter |
Subject: |
Re: Preserving newlines |
Date: |
Thu, 08 Jun 2006 19:50:09 +0200 |
On 2006-06-08 17:57:22 +0200 Nate Smith <nathan.smith@nist.gov> wrote:
So when I run it, and enter in:
Hi\n
That is four (4) characters you entered
It prints out:
output: |Hi\n|
So four (4) characters are printed,
but I want it to print out:
output: |Hi
|
and not three (3) as you would want it to.
I could always manually parse the output, and if a "\n" is found, then
really print a newline, but that seems a bit too muddled. Any ideas?
How is your program, or rather any of the functions/methods supposed
to know that you want your two character entry '\n' to be a one
character entry '(new line)' ?
Take a look at eg NSString-rangeOfString: you can use to 'parse' your
input string and 'scan' for the two characters '\n'
--
Chris