WriteString(id, s$[, len, encoding])
s$
to the file specified by id
. The optional
argument len
can be used to set the number of characters that should be
written to the file. If len
is omitted, the complete string is written.
The file cursor position is advanced by the number of bytes written to the
file. Note that this is not necessarily the same as len
because in UTF-8
encoding a single character can use up to 4 bytes.
The optional encoding
parameter can be used to set the character encoding
to use. This defaults to the default string encoding set using SetDefaultEncoding().
See Character encodings for details.
This function is used for writing text to files. If you need to write binary data to a file, use the WriteBytes() function instead. See WriteBytes for details.