EasyTextFile 1.0.1

Extension library to easily work with text files.

Install-Package EasyTextFile -Version 1.0.1
dotnet add package EasyTextFile --version 1.0.1
<PackageReference Include="EasyTextFile" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add EasyTextFile --version 1.0.1
The NuGet Team does not provide support for this client. Please contact its maintainers for support.

This library allows easy text file handling.

Example of use:


// Saving to hello.txt using a single string content.
"Hello, World!\nGood morning.".SaveToFile("hello.txt");

// Saving to vici.txt using a string array as content.
new [] {
	"I see.",
	"I come.",
	"I conquer."
}.SaveToFile("vici.txt");

// Load content to an array of string.
string[] text = "vici.txt".LoadFile();

// Load content from an embedded resource text file.
// Only use the resource file name, without the namespace.
string[] lines = "news.txt".LoadFromEmbeddedResource();

// Joining array of string into one string.
var oneLiner = new[] {
	"Easy come",
	"Easy go"
}.ToText(); // == "Easy come\nEasy go"

// Splitting a string to array, by cartridge return.
var lines = "You jump,\nI jump.".ToLines(); // will be split to an array of 2 strings.

New in version 1.0.1


// FileInfo extension
var fileInfo = new FileInfo("c:\\temp\\hello.txt");
var content = fileInfo.ReadContent();

Upcoming in version 1.0.2 : reading/writing to CSV files.

This library allows easy text file handling.

Example of use:


// Saving to hello.txt using a single string content.
"Hello, World!\nGood morning.".SaveToFile("hello.txt");

// Saving to vici.txt using a string array as content.
new [] {
	"I see.",
	"I come.",
	"I conquer."
}.SaveToFile("vici.txt");

// Load content to an array of string.
string[] text = "vici.txt".LoadFile();

// Load content from an embedded resource text file.
// Only use the resource file name, without the namespace.
string[] lines = "news.txt".LoadFromEmbeddedResource();

// Joining array of string into one string.
var oneLiner = new[] {
	"Easy come",
	"Easy go"
}.ToText(); // == "Easy come\nEasy go"

// Splitting a string to array, by cartridge return.
var lines = "You jump,\nI jump.".ToLines(); // will be split to an array of 2 strings.

New in version 1.0.1


// FileInfo extension
var fileInfo = new FileInfo("c:\\temp\\hello.txt");
var content = fileInfo.ReadContent();

Upcoming in version 1.0.2 : reading/writing to CSV files.

Release Notes

Added extension for FileInfo class.

Dependencies

This package has no dependencies.

This package is not used by any popular GitHub repositories.

Version History

Version Downloads Last updated
1.0.1 356 4/5/2018
1.0.0 313 3/31/2018