Nett icon indicating copy to clipboard operation
Nett copied to clipboard

Array of tables produces redundant empty line

Open AndrewSav opened this issue 5 years ago • 0 comments

Trying this:

class Test
{
	public string FirstName { get; set;}
	public string Surname { get; set;}
}
class Enc
{
	public Test[] Stuff {get; set;}
}

...

Test t1 = new Test { FirstName = "Bill", Surname = "Gates" };
Test t2 = new Test { FirstName = "Barbara", Surname = "Streisand" };
Test[] t = new[] { t1, t2 };
Enc e = new Enc {Stuff = t};
Console.WriteLine(Toml.WriteString(e));

Getting:


[[Stuff]]
FirstName = "Bill"
Surname = "Gates"
[[Stuff]]
FirstName = "Barbara"
Surname = "Streisand"

With an empty line as the very first line of the output. Is it possible not to produce it?

AndrewSav avatar Aug 08 '20 21:08 AndrewSav