WriteString

This function writes a string to a stream and adds the null character at the end.

Syntax

Parameters

Example

local path = "MyFile.dat" 

local stream = FileSystem:WriteFile(path)
if (stream==nil) then Debug:Error("Failed to write file.") end

stream:WriteString("Hello!")
stream:Seek(0)
System:Print(stream:ReadString())