problems countered after while(read()){} terminated with ^D or EOF

Andrej Mitrovic andrej.mitrovich at gmail.com
Thu Mar 22 14:07:14 PDT 2012


On 3/22/12, Tyro[17] <nospam at home.com> wrote:
> issue #2
>      how do i read a string[] such that whitespace (all or one of
> my choosing) delineate the string boundary?

Jesse Phillips has a cmdln.interact library that I think would work by using:
string[] result = userInput!(string[])("Enter space-delimited values:");
But it seems he changed his nickname on github and hasn't reuploaded
the library yet.

In case you're ever reading from a file you can do:
string input = cast(string)std.file.read("filename");
string[] text = input.split();


More information about the Digitalmars-d-learn mailing list