On Saturday, 24 February 2018 at 09:06:09 UTC, Domain wrote:
On Saturday, 24 February 2018 at 08:59:46 UTC, Domain wrote:
On Saturday, 24 February 2018 at 07:51:27 UTC, Domain wrote:
[...]
And why this not compile:
rows.each!(a => data ~= a.split(",").map!(b =>
b.strip).padRight("", 2));
On Saturday, 24 February 2018 at 08:59:46 UTC, Domain wrote:
On Saturday, 24 February 2018 at 07:51:27 UTC, Domain wrote:
[...]
And why this not compile:
rows.each!(a => data ~= a.split(",").map!(b =>
b.strip).padRight("", 2));
Error: cannot deduce function from argument types
!()(string
On Saturday, 24 February 2018 at 07:51:27 UTC, Domain wrote:
I want to convert a string like " a,b1, 23 " to
a 2D array like:
[["a", "b"],
["1", "2"],
["3", "" ]]
auto html = " a,b1, 23 ";
auto rows = html.strip.chomp("").split("");
string[][] data;
rows.each!(a => data ~= a.split(","));
str
I want to convert a string like " a,b1, 23 " to a
2D array like:
[["a", "b"],
["1", "2"],
["3", "" ]]
auto html = " a,b1, 23 ";
auto rows = html.strip.chomp("").split("");
string[][] data;
rows.each!(a => data ~= a.split(","));
string[][] result = data.map!(a => a.padRight("",
data[0].length