|
Archives
D Programming
digitalmars.Ddigitalmars.D.bugs digitalmars.D.dtl digitalmars.D.ide digitalmars.D.dwt digitalmars.D.announce digitalmars.D.learn digitalmars.D.debugger D.gnu D C/C++ Programming
c++c++.announce c++.atl c++.beta c++.chat c++.command-line c++.dos c++.dos.16-bits c++.dos.32-bits c++.idde c++.mfc c++.rtl c++.stl c++.stl.hp c++.stl.port c++.stl.sgi c++.stlsoft c++.windows c++.windows.16-bits c++.windows.32-bits c++.wxwindows digitalmars.empire digitalmars.DMDScript electronics |
digitalmars.D.learn - Using to! ?
Hi, Given the example below: string str = "1 2 3 4 5 6"; double[] numbers = to!(double[])(split(str)); writefln(to!string(numbers)); I get [1, 2, 3, 4, 5, 6] which is okay. How do I output it with different separators? What I would like to get is [ 1 2 3 4 5 6 ] or ( 1 2 3 4 5 6 ). unknown Jun 17 2009
unknown Wrote:Hi, Given the example below: string str = "1 2 3 4 5 6"; double[] numbers = to!(double[])(split(str)); writefln(to!string(numbers)); I get [1, 2, 3, 4, 5, 6] which is okay. How do I output it with different separators? What I would like to get is [ 1 2 3 4 5 6 ] or ( 1 2 3 4 5 6 ). unknown Jun 17 2009
John C Wrote: Thanks John, I already figured it out. There should be an example in the unit tests. Cheers, unknownunknown Wrote:Hi, Given the example below: string str = "1 2 3 4 5 6"; double[] numbers = to!(double[])(split(str)); writefln(to!string(numbers)); I get [1, 2, 3, 4, 5, 6] which is okay. How do I output it with different separators? What I would like to get is [ 1 2 3 4 5 6 ] or ( 1 2 3 4 5 6 ). unknown Jun 17 2009
unknown Wrote: Figured it out. Forget it.Hi, Given the example below: string str = "1 2 3 4 5 6"; double[] numbers = to!(double[])(split(str)); writefln(to!string(numbers)); I get [1, 2, 3, 4, 5, 6] which is okay. How do I output it with different separators? What I would like to get is [ 1 2 3 4 5 6 ] or ( 1 2 3 4 5 6 ). unknown Jun 17 2009
|