foreach over split string

John Colvin john.loughran.colvin at gmail.com
Wed Jul 17 07:18:23 PDT 2013


On Wednesday, 17 July 2013 at 14:09:28 UTC, JS wrote:
> Ok, spoke too soon again,
>
> my string requires compound splitting:
>
> foreach(ss; split(s, ","))
> {
>     split(ss, "|"); // ss can't be read at compile time 
> although I can use ss directly
>     string a = ss; // works fine.
> }

Is there any possibility you could provide a compilable example 
(or not compilable, if that's the point :p )? It's an awful lot 
easier to quickly give the right answer to a question if you take 
the time to ask it clearly and precisely, in one go, with a 
minimised example.
Also, by virtue of you having made an example and checked it, it 
prevents accidentally talking about problems in code that is 
actually fine.


More information about the Digitalmars-d-learn mailing list