VFile.WriteAllLines Method
Namespace: Rebex.IO
Assembly: Rebex.FileSystem.dll (version 7.0.9448)
WriteAllLines(String, IEnumerable<String>)
Method writes the contents to a file identified by the path.
Declaration
public static void WriteAllLines(string path, IEnumerable<string> contents)
Parameters
| Type | Name | Description |
|---|---|---|
| String | path | The path of the file. |
| IEnumerable<String> | contents | Lines to write to the |
Remarks
The contents is written using the UTF-8 encoding.
Method creates the file if it does not exist, opens the file, writes the content and closes the file.
WriteAllLines(String, String[])
Method writes the contents to a file identified by the path.
Declaration
public static void WriteAllLines(string path, string[] contents)
Parameters
| Type | Name | Description |
|---|---|---|
| String | path | The path of the file. |
| String[] | contents | Lines to write to the |
Remarks
The contents is written using the UTF-8 encoding.
Method creates the file if it does not exist, opens the file, writes the content and closes the file.
WriteAllLines(String, String[], Encoding)
Method writes the contents to a file identified by the path
and using the encoding.
Declaration
public static void WriteAllLines(string path, string[] contents, Encoding encoding)
Parameters
| Type | Name | Description |
|---|---|---|
| String | path | The path of the file. |
| String[] | contents | Lines to write to the |
| Encoding | encoding | The character encoding. |
Remarks
Method creates the file if it does not exist, opens the file, writes the content and closes the file.
WriteAllLines(String, IEnumerable<String>, Encoding)
Method writes the contents to a file identified by the path
and using the encoding.
Declaration
public static void WriteAllLines(string path, IEnumerable<string> contents, Encoding encoding)
Parameters
| Type | Name | Description |
|---|---|---|
| String | path | The path of the file. |
| IEnumerable<String> | contents | Lines to write to the |
| Encoding | encoding | The character encoding. |
Remarks
Method creates the file if it does not exist, opens the file, writes the content and closes the file.