Skip to content

format

typescript
FileStream.WriteAllString(val)

class: FileStream

description

Writes the contents of the specified string to a file stream.

parameter

param_nametypedescription
valstringThe string to be written.

reture

typedescription
void

code example

javascript
function Test(path: string) {  
    try {
        let fileWrite = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write);  
        let str = "FileStream Write String";   
        fileWrite.WriteAllString(str);  
        fileWrite.Close();  
    } catch (error) {
        Debug.Error(error);
    }
}