InputString

InputString[]

interactively reads in a character string.

InputString[prompt]

requests input, displaying prompt as a "prompt".

InputString[prompt,init]

in a notebook front end uses init as the initial contents of the input field.

Details and Options

  • InputString returns what it reads as a string, without evaluation.
  • The operation of InputString may vary from one computer system to another. When a Wolfram System front end is used, InputString typically works through a dialog box.
  • When no front end is used, InputString reads from standard input.
  • If the standard input is a file, then InputString returns EndOfFile if you try to read past the end of the file.
  • On systems with textual input, InputString[] uses ? as a prompt.
  • When InputString is evaluated, the Wolfram System stops until the input has been read.
  • With a notebook front end, InputString by default puts up a dialog window with a standard appearance.
  • The prompt given can be text, graphics or any expression.
  • InputString takes notebook options. The default settings include WindowFloating->False, WindowSize->All, and WindowTitle->None.
  • InputString by default puts up a dialog in the middle of the main display screen. Explicit settings for WindowMargins override this.
  • The options for InputField can be given directly as options to InputString to control the properties of the input field.
  • InputString[prompt] is equivalent to InputString[prompt,""].

Examples

open allclose all

Basic Examples  (2)

Get a string from input:

Encode an input string:

Decode:

Applications  (1)

Make a password dialog:

Wolfram Research (1988), InputString, Wolfram Language function, https://reference.wolfram.com/language/ref/InputString.html (updated 2014).

Text

Wolfram Research (1988), InputString, Wolfram Language function, https://reference.wolfram.com/language/ref/InputString.html (updated 2014).

CMS

Wolfram Language. 1988. "InputString." Wolfram Language & System Documentation Center. Wolfram Research. Last Modified 2014. https://reference.wolfram.com/language/ref/InputString.html.

APA

Wolfram Language. (1988). InputString. Wolfram Language & System Documentation Center. Retrieved from https://reference.wolfram.com/language/ref/InputString.html

BibTeX

@misc{reference.wolfram_2024_inputstring, author="Wolfram Research", title="{InputString}", year="2014", howpublished="\url{https://reference.wolfram.com/language/ref/InputString.html}", note=[Accessed: 03-December-2024 ]}

BibLaTeX

@online{reference.wolfram_2024_inputstring, organization={Wolfram Research}, title={InputString}, year={2014}, url={https://reference.wolfram.com/language/ref/InputString.html}, note=[Accessed: 03-December-2024 ]}