toml-lang / toml-test

A language agnostic test suite for TOML parsers.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Array of tables produces redundant empty line

AndrewSav opened this issue · 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?

Sorry wrong repo.