Function to write a string to a file. This function can create new files. Existing files will be overwritten. This function is the equivalent of the method .writeFile()
var content = "String to insert into file"; var file = new File("C:/myfile.txt"); writeFile(file, content);
Parameter | Data type | Required | Description |
---|---|---|---|
file | file object | True | The file to write the string to |
content | string | The string to write to the file | |
encoding | string | The encoding to write the file. When not specified the default encoding UTF-8 is used. |
This method has no return values.