How to split a string to a 2D array

Domain dont_email at empty.com
Sat Feb 24 09:06:09 UTC 2018


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[]), candidates are:
> C:\D\dmd2\windows\bin\..\..\src\phobos\std\algorithm\iteration.d(899): C:\D\dmd2\windows\bin\..\..\src\phobos\std\algorithm\iteration.d(934):

OK, this compile:
rows.each!(a => data ~= a.split(",").map!(b => 
b.strip).padRight("", 2).array);


More information about the Digitalmars-d-learn mailing list