Search code examples
stringerlangerl

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.


Solution

  • 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"