Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: catching \n (newline)
Date: Tue, 21 Aug 2007 19:54:54 +0000 (UTC)
Organization: Tel-Aviv University
Lines: 24
Message-ID: <faffue$g3h$1@fred.mathworks.com>
References: <fad4r2$m0a$1@fred.mathworks.com> <fad87q$leu$1@canopus.cc.umanitoba.ca> <faelpg$j2d$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-03-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1187726094 16497 172.30.248.38 (21 Aug 2007 19:54:54 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 21 Aug 2007 19:54:54 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 482202
Xref: news.mathworks.com comp.soft-sys.matlab:424840



Even better, thanks Yair.

-naor
"Yair Altman" <altmanyDEL@gmailDEL.comDEL> wrote in message 
<faelpg$j2d$1@fred.mathworks.com>...
> > >>> a=sprintf('\n');
> > >>> strcmp(a,'\n')
> 
> replace with: strcmp(a,sprinf('\n'));
> 
> Note: this is a platform-independent solution, that takes
> care of Unix (\n=char(10)), PCs (\n=[char(10),char(13)]) 
and
> Macs (\n=char(13)). Don't use char(10),char(13) unless
> you're certain about your intended platform. FYI, you can
> get your system's line separator using the following:
> 
> double(char(java.lang.System.getProperty
('line.separator')))
> 
> Yair Altman
> http://ymasoftware.com
>