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.


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

- WriteString will open a file for writing, erasing all existing data, if it is not already open.
- WriteString[File["file"],…] is also supported.
- WriteString uses the OutputForm of the expri.
- WriteString does not put a newline at the end of the output it generates.
Examples
open all close allBasic Examples (2)
Scope (1)
Properties & Relations (1)
WriteString does not insert line breaks after each string it writes:
Use WriteLine to automatically insert a trailing newline:
Tech Notes
Related Guides
History
Introduced in 1988 (1.0) | Updated in 2003 (5.0) ▪ 2016 (11.0)
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_2025_writestring, author="Wolfram Research", title="{WriteString}", year="2016", howpublished="\url{https://reference.wolfram.com/language/ref/WriteString.html}", note=[Accessed: 08-August-2025]}
BibLaTeX
@online{reference.wolfram_2025_writestring, organization={Wolfram Research}, title={WriteString}, year={2016}, url={https://reference.wolfram.com/language/ref/WriteString.html}, note=[Accessed: 08-August-2025]}