On 02/28/2019 01:17 PM, Cleverson Casarin Uliana wrote:

> I experimented substituting readf for readln, but then it doesn't
> recognize my Enter presses and hangs on.
>
> What is a more suitable aproach to this problem please?

readln and strip works, and formattedRead can be useful as well. I have an example here:

  http://ddili.org/ders/d.en/strings.html#ix_strings.readln

import std.stdio;
import std.string;

void main() {
    char[] name;

    write("What is your name? ");
    readln(name);
    name = strip(name);

    writeln("Hello ", name, "!");
}

Ali

Reply via email to