Path: news.mathworks.com!newsfeed-00.mathworks.com!kanaga.switch.ch!news-zh.switch.ch!switch.ch!news.k-dsl.de!feeder.eternal-september.org!eternal-september.org!not-for-mail
From: dpb <none@non.net>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Compare strings of different lengths without using strcmp?
Date: Thu, 24 Sep 2009 15:10:15 -0500
Organization: A noiseless patient Spider
Lines: 14
Message-ID: <h9gjvo$tmg$1@news.eternal-september.org>
References: <1060919098.4446.1253822970612.JavaMail.root@gallium.mathforum.org>
Mime-Version: 1.0
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 7bit
X-Trace: news.eternal-september.org U2FsdGVkX19A07D4gcF9LO5mQmRN6xzSknXghNvDI9OTXSEdu/74qfymQsBPwd1i0FN/F+KQv7KMKY7v7HZ0uxidKGMLcjwV+iLCQzCVbZppuYui8gwj9bnjOWvuxZokIKDuUWNbaJY=
X-Complaints-To: abuse@eternal-september.org
NNTP-Posting-Date: Thu, 24 Sep 2009 20:14:49 +0000 (UTC)
In-Reply-To: <1060919098.4446.1253822970612.JavaMail.root@gallium.mathforum.org>
X-Auth-Sender: U2FsdGVkX18xyduCmJEAp3a5JTPMpi6y
Cancel-Lock: sha1:Z+z9xInABfX7Bfp6QiIKJZwBtKo=
User-Agent: Thunderbird 2.0.0.22 (Windows/20090605)
Xref: news.mathworks.com comp.soft-sys.matlab:572734


NouveauIX wrote:
> I'm trying to compare two strings with if statements without using strcmp.
> 
> function log=myStrCmpI(char1,char2)
> c1=lower(char1);
> c2=lower(char2);
> if ?
>     log=true;
...
Well, one has to start w/ a clear definition of what the criterion for 
equality would be.  If the two aren't the same length, then they 
obviously can't be identical so what would "true" be indicating, anyway?

--