({{, (RefLink[InputString, paclet:ref/InputString])[]
interactively reads in a character string. }, {, (RefLink[InputString, paclet:ref/InputString])[prompt]
requests input, displaying prompt as a "prompt". }, {, (RefLink[InputString, paclet:ref/InputString])[prompt,init]
in a notebook front end uses init as the initial contents of the input field.}})

OpenersNotesSection(Spacer1)Details and Options

(RefLink[InputString, paclet:ref/InputString]) returns what it reads as a string, without evaluation.

The operation of (RefLink[InputString, paclet:ref/InputString]) may vary from one computer system to another. When a Wolfram System front end is used, (RefLink[InputString, paclet:ref/InputString]) typically works through a dialog box.

When no front end is used, (RefLink[InputString, paclet:ref/InputString]) reads from standard input.

If the standard input is a file, then (RefLink[InputString, paclet:ref/InputString]) returns (RefLink[EndOfFile, paclet:ref/EndOfFile]) if you try to read past the end of the file.

On systems with textual input, (RefLink[InputString, paclet:ref/InputString])[] uses ? as a prompt.

When (RefLink[InputString, paclet:ref/InputString]) is evaluated, the Wolfram System stops until the input has been read.

With a notebook front end, (RefLink[InputString, paclet:ref/InputString]) by default puts up a dialog window with a standard appearance.

The prompt given can be text, graphics or any expression.

(RefLink[InputString, paclet:ref/InputString]) takes notebook options. The default settings include (RefLink[WindowFloating, paclet:ref/WindowFloating])->(RefLink[False, paclet:ref/False]), (RefLink[WindowSize, paclet:ref/WindowSize])->(RefLink[All, paclet:ref/All]), and (RefLink[WindowTitle, paclet:ref/WindowTitle])->(RefLink[None, paclet:ref/None]).

(RefLink[InputString, paclet:ref/InputString]) by default puts up a dialog in the middle of the main display screen. Explicit settings for (RefLink[WindowMargins, paclet:ref/WindowMargins]) override this.

The options for (RefLink[InputField, paclet:ref/InputField]) can be given directly as options to (RefLink[InputString, paclet:ref/InputString]) to control the properties of the input field.

(RefLink[InputString, paclet:ref/InputString])[prompt] is equivalent to (RefLink[InputString, paclet:ref/InputString])[prompt,""].

OpenersPrimaryExamplesSection(Spacer1)Examples  (3)

OpenersExampleSection0(Spacer1)Basic Examples  (2)

Get a string from input:

InputString[]

Encode an input string:

{b,e}=Sort[ToCharacterCode["az"]];
cipher= Thread[RandomSample[Range[b,e]]->Range[b,e]];

enc=FromCharacterCode[ToCharacterCode[InputString[]] /. cipher]

Decode:

FromCharacterCode[ToCharacterCode[enc] /. Map[Reverse, cipher]]

OpenersExampleSection1(Spacer1)Applications  (1)

Make a password dialog:

InputString["Password:", FieldMasked->True]

({{DocumentationFooterIconsRelatedFunction.png, ({{See Also}, {(RefLink[Input, paclet:ref/Input])  ▪  (RefLink[Ask, paclet:ref/Ask])  ▪  (RefLink[InputField, paclet:ref/InputField])  ▪  (RefLink[Import, paclet:ref/Import])  ▪  (RefLink[FormFunction, paclet:ref/FormFunction])}})}})

({{DocumentationFooterIconsRelatedTutorial.png, ({{Tutorials}, {▪(RefLinkPlain[Requesting Input, paclet:tutorial/RequestingInput])}})}})

({{DocumentationFooterIconsRelatedGuide.png, ({{Related Guides}, {▪(RefLinkPlain[Custom Interface Construction, paclet:guide/CustomInterfaceConstruction])}, {▪(RefLinkPlain[Dialog Boxes, paclet:guide/DialogBoxes])}, {▪(RefLinkPlain[Basic Input & Output in Programs, paclet:guide/BasicInputAndOutputInPrograms])}})}})