Files.WriteString Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
| Name | Description |
|---|---|
| WriteString(IPath, ICharSequence, IOpenOption[]) |
Write a CharSequence to a file. |
| WriteString(IPath, String, IOpenOption[]) | |
| WriteString(IPath, ICharSequence, Charset, IOpenOption[]) |
Write a CharSequence to a file. |
| WriteString(IPath, String, Charset, IOpenOption[]) |
WriteString(IPath, ICharSequence, IOpenOption[])
Write a CharSequence to a file.
[Android.Runtime.Register("writeString", "(Ljava/nio/file/Path;Ljava/lang/CharSequence;[Ljava/nio/file/OpenOption;)Ljava/nio/file/Path;", "", ApiSince=36)]
public static Java.Nio.FileNio.IPath? WriteString(Java.Nio.FileNio.IPath? path, Java.Lang.ICharSequence? csq, params Java.Nio.FileNio.IOpenOption[]? options);
[<Android.Runtime.Register("writeString", "(Ljava/nio/file/Path;Ljava/lang/CharSequence;[Ljava/nio/file/OpenOption;)Ljava/nio/file/Path;", "", ApiSince=36)>]
static member WriteString : Java.Nio.FileNio.IPath * Java.Lang.ICharSequence * Java.Nio.FileNio.IOpenOption[] -> Java.Nio.FileNio.IPath
Parameters
- path
- IPath
the path to the file
- csq
- ICharSequence
the CharSequence to be written
- options
- IOpenOption[]
options specifying how the file is opened
Returns
the path
- Attributes
Remarks
Write a CharSequence to a file. Characters are encoded into bytes using the UTF-8 charset. This method is equivalent to: writeString(path, csq, StandardCharsets.UTF_8, options).
Java reference for java.nio.file.Files.writeString.
Applies to
WriteString(IPath, String, IOpenOption[])
public static Java.Nio.FileNio.IPath? WriteString(Java.Nio.FileNio.IPath? path, string? csq, params Java.Nio.FileNio.IOpenOption[]? options);
static member WriteString : Java.Nio.FileNio.IPath * string * Java.Nio.FileNio.IOpenOption[] -> Java.Nio.FileNio.IPath
Parameters
- path
- IPath
- csq
- String
- options
- IOpenOption[]
Returns
Applies to
WriteString(IPath, ICharSequence, Charset, IOpenOption[])
Write a CharSequence to a file.
[Android.Runtime.Register("writeString", "(Ljava/nio/file/Path;Ljava/lang/CharSequence;Ljava/nio/charset/Charset;[Ljava/nio/file/OpenOption;)Ljava/nio/file/Path;", "", ApiSince=36)]
public static Java.Nio.FileNio.IPath? WriteString(Java.Nio.FileNio.IPath? path, Java.Lang.ICharSequence? csq, Java.Nio.Charset.Charset? cs, params Java.Nio.FileNio.IOpenOption[]? options);
[<Android.Runtime.Register("writeString", "(Ljava/nio/file/Path;Ljava/lang/CharSequence;Ljava/nio/charset/Charset;[Ljava/nio/file/OpenOption;)Ljava/nio/file/Path;", "", ApiSince=36)>]
static member WriteString : Java.Nio.FileNio.IPath * Java.Lang.ICharSequence * Java.Nio.Charset.Charset * Java.Nio.FileNio.IOpenOption[] -> Java.Nio.FileNio.IPath
Parameters
- path
- IPath
the path to the file
- csq
- ICharSequence
the CharSequence to be written
- cs
- Charset
the charset to use for encoding
- options
- IOpenOption[]
options specifying how the file is opened
Returns
the path
- Attributes
Remarks
Write a CharSequence to a file. Characters are encoded into bytes using the specified charset. All characters are written as they are, including the line separators in the char sequence. No extra characters are added. The options parameter specifies how the file is created or opened. If no options are present then this method works as if the CREATE, TRUNCATE_EXISTING, and WRITE options are present. In other words, it opens the file for writing, creating the file if it doesn't exist, or initially truncating an existing regular-file to a size of 0.
Java reference for java.nio.file.Files.writeString.
Applies to
WriteString(IPath, String, Charset, IOpenOption[])
public static Java.Nio.FileNio.IPath? WriteString(Java.Nio.FileNio.IPath? path, string? csq, Java.Nio.Charset.Charset? cs, params Java.Nio.FileNio.IOpenOption[]? options);
static member WriteString : Java.Nio.FileNio.IPath * string * Java.Nio.Charset.Charset * Java.Nio.FileNio.IOpenOption[] -> Java.Nio.FileNio.IPath
Parameters
- path
- IPath
- csq
- String
- cs
- Charset
- options
- IOpenOption[]