<!--
{
  "documentType" : "article",
  "framework" : "Swift",
  "identifier" : "/documentation/Swift/input-and-output",
  "metadataVersion" : "0.1.0",
  "role" : "collectionGroup",
  "title" : "Input and Output"
}
-->

# Input and Output

Print values to the console, read from and write to text streams, and use command
line arguments.

## Topics

### Text Output

[`print(_:separator:terminator:)`](/documentation/Swift/print(_:separator:terminator:))

Writes the textual representations of the given items into the standard
output.

[`print(_:separator:terminator:to:)`](/documentation/Swift/print(_:separator:terminator:to:))

Writes the textual representations of the given items into the given output
stream.

### Command Line Input

[`CommandLine`](/documentation/Swift/CommandLine)

Command-line arguments for the current process.

[`readLine(strippingNewline:)`](/documentation/Swift/readLine(strippingNewline:))

Returns a string read from standard input through the end of the current
line or until EOF is reached.

### Streams

[`TextOutputStream`](/documentation/Swift/TextOutputStream)

A type that can be the target of text-streaming operations.

[`TextOutputStreamable`](/documentation/Swift/TextOutputStreamable)

A source of text-streaming operations.



---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)