Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: catching \n (newline)
Date: Tue, 21 Aug 2007 12:28:32 +0000 (UTC)
Organization: TACT Computer Systems Ltd
Lines: 16
Message-ID: <faelpg$j2d$1@fred.mathworks.com>
References: <fad4r2$m0a$1@fred.mathworks.com> <fad87q$leu$1@canopus.cc.umanitoba.ca>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1187699312 19533 172.30.248.37 (21 Aug 2007 12:28:32 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 21 Aug 2007 12:28:32 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 642467
Xref: news.mathworks.com comp.soft-sys.matlab:424770


> >>> 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