Skip to content

Commit e965b13

Browse files
adamsitnikgewarren
andauthored
File.OpenWrite doc improvements (#10822)
* remove redundant comments from the snippet * fix the description --------- Co-authored-by: Genevieve Warren <[email protected]>
1 parent e86c6de commit e965b13

File tree

2 files changed

+1
-14
lines changed

2 files changed

+1
-14
lines changed

snippets/csharp/System.IO/FileInfo/OpenWrite/file openwrite.cs

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -34,18 +34,5 @@ public static void Main()
3434
}
3535
}
3636
//This code produces output similar to the following;
37-
//results may vary based on the computer/file structure/etc.:
38-
//
3937
//This is to test the OpenWrite method.
40-
//
41-
//
42-
//
43-
//
44-
//
45-
//
46-
//
47-
//
48-
//
49-
//
50-
//
5138
// </Snippet1>

xml/System.IO/FileInfo.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2137,7 +2137,7 @@ The following example demonstrates moving a file to a different location and ren
21372137
<format type="text/markdown"><![CDATA[
21382138
21392139
## Remarks
2140-
The <xref:System.IO.FileInfo.OpenWrite%2A> method opens a file if one already exists for the file path, or creates a new file if one does not exist. For an existing file, it does not append the new text to the existing text. Instead, it overwrites the existing characters with the new characters. If you overwrite a longer string (such as "This is a test of the OpenWrite method") with a shorter string (like "Second run"), the file will contain a mix of the strings ("Second runtest of the OpenWrite method").
2140+
The <xref:System.IO.FileInfo.OpenWrite%2A> method opens a file if one already exists for the file path, or creates a new file if one does not exist. For an existing file, it does not append the new text to the existing text. Instead, it overwrites the existing characters with the new characters. If you overwrite a longer string (such as "This is a test of the OpenWrite method") with a shorter string (like "Second run"), the file will contain a mix of the strings ("Second run test of the OpenWrite method.").
21412141
21422142
21432143

0 commit comments

Comments
 (0)