io.read(*l) does not ignore newline character as documented

hey all, got a problem with file handling

the documentation for io.read says:

“*l”: reads the next line (skipping the end of line), returning nil on end of file. This is the default format.

however, the resulting string ‘does’ include the eof character at the end, this is annoying, because as lua strings are immutable, it’s a bit of a hassle to remove the character, and requires the string to be duplicated. anyone know why this is? or have a more elegant solution?(like specifying read delimiters or something) I’m quite new to lua, so any tricks or tips are appreciated.

cheers
Jono [import]uid: 68278 topic_id: 18521 reply_id: 318521[/import]