Jagan PJ
Jagan PJ

Reputation: 9

How to take String input with spaces in erlang with io:fread or io:read

I just want to take a string input from the user in erlang programming.

Upvotes: 1

Views: 340

Answers (1)

legoscia
legoscia

Reputation: 41528

I think the function you're looking for is io:get_line/1:

1> io:get_line("enter data: ").
enter data: data with spaces
"data with spaces\n"

Upvotes: 5

Related Questions