October 22, 2005 std.string.split() | ||||
---|---|---|---|---|
| ||||
Hi, I've just discovered D and have loaded the GCC fronted on my Mac. I'm trying some simple stuff and have come across a problem. I'm using string.split("a line of text with % in it, some more text", ","). Split seems to choke on lines with a "%" in. Is this normal behaviour? Would std.regexp.split be a better bet? Thanks Gareth Baker |
October 23, 2005 Re: std.string.split() | ||||
---|---|---|---|---|
| ||||
Posted in reply to Gareth Baker | Gareth Baker wrote:
> Hi,
>
> I've just discovered D and have loaded the GCC fronted on my Mac. I'm trying some simple stuff and have come across a problem. I'm using string.split("a line of text with % in it, some more text", ","). Split seems to choke on lines with a "%" in. Is this normal behaviour? Would std.regexp.split be a better bet?
>
> Thanks
> Gareth Baker
Hi,
Split should not choke on the %... But your output method may. Try printing the substrings with writef("%s",str);
/Oskar
|
Copyright © 1999-2021 by the D Language Foundation