Wolfram Language & System 10.3 (2015)|Legacy Documentation

This is documentation for an earlier version of the Wolfram Language.View current documentation (Version 11.2)

InsertLinebreaks

InsertLinebreaks["string"]
inserts newline characters into string to make a string in which no line is longer than 78 characters.

InsertLinebreaks["string",n]
inserts newline characters to make no line longer than n characters.

DetailsDetails

  • InsertLinebreaks works by replacing whitespace with newline characters.
  • If a single span of non-whitespace characters is longer than n characters, newlines will be inserted every n characters within the span.

ExamplesExamplesopen allclose all

Basic Examples  (1)Basic Examples  (1)

Insert newlines to ensure no line is longer than 30 characters:

In[1]:=
Click for copyable input
Out[1]=

Words longer than 30 characters will be broken:

In[2]:=
Click for copyable input
Out[2]=
Introduced in 2015
(10.1)