[Date Prev][Date Next][Thread Prev][Thread Next]
[Date Index]
[Thread Index]
- Subject: string.byte()
- From: Markus Huber <pulse@...>
- Date: Mon, 10 Feb 2003 16:25:04 +0100 (GMT)
string.byte('') --> bad argument #2 to `byte' (out of range)
I don't feel that an empty string is an bad argument. I think to return
nil in this case is more usefull because:
if string.byte(s)==47 then ... end
Instead of:
if string.len(s)>0 and string.byte(s)==47 then ... end
Nearly all string functions can cope with nullstrings. Why
is string.byte() an exception?
--
Markus