Problem with string.whitespace and newline
Andrej Mitrovic
andrej.mitrovich at gmail.com
Sat Jun 11 18:14:23 PDT 2011
try return join(split(x),whitespace[]);
It seems whitespace is a static array.
On 6/12/11, Michael Chen <sth4nth at gmail.com> wrote:
> The following code cannot be compiled
> string clean(string x)
> {
> return join(split(x),whitespace);
> }
>
> The compile error is
> Error 2 Error: template std.array.join(RoR,R) if (isInputRange!(RoR)
> && isInputRange!(ElementType!(RoR)) && isForwardRange!(R)) cannot
> deduce template function from argument types
> !()(string[],immutable(char[6u]))
>
> However this line is fine
> join(split(x)," ");
>
>
> The same problem happens when using newline. Is this a bug?
>
> Best,
> Mike
>
More information about the Digitalmars-d
mailing list