Skip to content

Commit

Permalink
File.OpenWrite doc improvements (#10822)
Browse files Browse the repository at this point in the history
* remove redundant comments from the snippet

* fix the description

---------

Co-authored-by: Genevieve Warren <[email protected]>
  • Loading branch information
adamsitnik and gewarren authored Jan 9, 2025
1 parent e86c6de commit e965b13
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 14 deletions.
13 changes: 0 additions & 13 deletions snippets/csharp/System.IO/FileInfo/OpenWrite/file openwrite.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,18 +34,5 @@ public static void Main()
}
}
//This code produces output similar to the following;
//results may vary based on the computer/file structure/etc.:
//
//This is to test the OpenWrite method.
//
//
//
//
//
//
//
//
//
//
//
// </Snippet1>
2 changes: 1 addition & 1 deletion xml/System.IO/FileInfo.xml
Original file line number Diff line number Diff line change
Expand Up @@ -2137,7 +2137,7 @@ The following example demonstrates moving a file to a different location and ren
<format type="text/markdown"><![CDATA[
## Remarks
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").
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.").
Expand Down

0 comments on commit e965b13

Please sign in to comment.