Javatpoint Logo
Javatpoint Logo

C# StreamWriter

C# StreamWriter class is used to write characters to a stream in specific encoding. It inherits TextWriter class. It provides overloaded write() and writeln() methods to write data into file.

C# StreamWriter example

Let's see a simple example of StreamWriter class which writes a single line of data into the file.


File created successfully...

Now open the file, you will see the text "hello c#" in output.txt file.


hello c#
Next TopicC# StreamReader

Youtube For Videos Join Our Youtube Channel: Join Now


Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Trending Technologies

B.Tech / MCA