[Date Prev][Date Next][Thread Prev][Thread Next]
- Subject: Re: strings
- From: David Given <dg@...>
- Date: Sun, 21 Dec 2008 21:02:46 +0000
Sean Farrow wrote:
> if a string is empty, i.e "" can I compare it with nil?
If you like, but the result will always be false (because an empty
string *isn't* nil).
You can compare for equality (or inequality) any two values, regardless
You can only do an ordered compare (<, <=, etc) on two values of the
same type, subject to metatable tricks: that's pretty much only numbers
or strings, for example. (But not numbers *and* strings; "3" < 3 will
produce a type error).
┌─── ｄｇ＠ｃｏｗｌａｒｋ．ｃｏｍ ───── http://www.cowlark.com ─────
│ "A line dancer near a graduated cylinder, the blithe spirit inside
│ some wheelbarrow, and a tomato are what made America great!" ---
│ received via spam
Description: OpenPGP digital signature