Re: Convert output of map() to array of strings

2018-08-15 Thread Paul Backus via Digitalmars-d-learn
On Wednesday, 15 August 2018 at 13:53:02 UTC, Andrey wrote: Hello, I have the following code: string[] list; string text; // ... enum pattern = ctRegex!`^[0-9]+$`; list = text.split('\n').map!(line => line.matchFirst(pattern).hit); Compiler says that it can't convert result of map function to

Convert output of map() to array of strings

2018-08-15 Thread Andrey via Digitalmars-d-learn
Hello, I have the following code: string[] list; string text; // ... enum pattern = ctRegex!`^[0-9]+$`; list = text.split('\n').map!(line => line.matchFirst(pattern).hit); Compiler says that it can't convert result of map function to string[]... What I want: 1. Split some text into lines us