September Morn Update
This commit is contained in:
parent
4e2d22a71d
commit
aac6731f2c
6856 changed files with 141342 additions and 21127 deletions
|
|
@ -1,4 +1,7 @@
|
|||
str = "" -- create empty string
|
||||
-- create an empty string 3 different ways
|
||||
str = ""
|
||||
str = ''
|
||||
str = [[]]
|
||||
|
||||
-- test for empty string
|
||||
if str == "" then
|
||||
|
|
@ -9,3 +12,14 @@ end
|
|||
if str ~= "" then
|
||||
print "The string is not empty"
|
||||
end
|
||||
|
||||
-- several different ways to check the string's length
|
||||
if string.len(str) == 0 then
|
||||
print "The library function says the string is empty."
|
||||
end
|
||||
if str:len() == 0 then
|
||||
print "The method call says the string is empty."
|
||||
end
|
||||
if #str == 0 then
|
||||
print "The unary operator says the string is empty."
|
||||
end
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue