WriteString

WriteString["file","string"]

writes "string" to a file.

WriteString[channel,"string"]

writes "string" to a stream or process.

WriteString[channel,expr1,expr2,]

converts the expri to strings, and then writes them in sequence to the specified output channel.

Details

Examples

open allclose all

Basic Examples  (2)

Write a string to a temporary file:

Print the file:

Close the file:

Delete the temporary file:

Open a stream:

Write to the stream:

Close the stream:

Print the file:

Scope  (1)

Write a string to a File object:

Print the file:

Delete the file:

Properties & Relations  (1)

WriteString does not insert line breaks after each string it writes:

Use WriteLine to automatically insert a trailing newline:

Delete the temporary file:

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

Text

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

CMS

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

APA

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

BibTeX

@misc{reference.wolfram_2023_writestring, author="Wolfram Research", title="{WriteString}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/WriteString.html}", note=[Accessed: 19-March-2024 ]}

BibLaTeX

@online{reference.wolfram_2023_writestring, organization={Wolfram Research}, title={WriteString}, year={2016}, url={https://reference.wolfram.com/language/ref/WriteString.html}, note=[Accessed: 19-March-2024 ]}