lua-l archive
[
Date Prev
][
Date Next
][
Thread Prev
][
Thread Next
] [
Date Index
] [
Thread Index
]
Subject
:
Re: strings
From
: "RJP Computing" <rjpcomputing@
...
>
Date
: Sun, 21 Dec 2008 16:06:53 -0500
On Sun, Dec 21, 2008 at 3:53 PM, Sean Farrow
<
sean.farrow@seanfarrow.co.uk
>
wrote:
Hi:
if a string is empty, i.e "" can I compare it with nil?
Chers
Sean.
Use 'string.len()' to compare the size to 0.
example:
local str = ""
if str:len() == 0 then
print( "The string is empty" )
else
print( "The string has some content" )
end
--
Regards,
Ryan
Follow-Ups
:
Re: strings
,
Luiz Henrique de Figueiredo
References
:
strings
,
Sean Farrow
Prev by Date:
Re: strings
Next by Date:
Re: strings
Previous by thread:
Re: strings
Next by thread:
Re: strings
Index(es):
Date
Thread