pub fn read_string(msg: Option<&str>) -> StringExpand description
§ARGUMENTS
‘msg’ (Option<&str>) - an optional message which will be printed at the same line as the input prompt. Must be set to Some(“…”) or None.
§DESCRIPTION
Prompts the user to type a string of text which will then be returned.
Provides an information message on the same line as the prompt if Some(…) is provided, and just the prompt if None is provided.
§RETURNS
A trimmed String value provided by the user.
§EXAMPLES
use quick_input::read_string;
let user_str_with_msg = read_string(Some("Please input some text: "));
let user_str: String = read_string(None);