>>  <<  Usr  Pri  JfC  LJ  Phr  Dic  Voc  !:  Help  User

This script defines text utilities and is included in the J standard library. Definitions are loaded into the z locale.

Definitions

C cutpara
F foldpara, foldtext
T topara

cutpara (verb)

Cut text into boxed list of paragraphs.

Syntax

cutpara text

Example

   cutpara 'one',LF,'two',LF2,'three'
┌────────┬─────┐
│one two │three│
└────────┴─────┘

foldpara (verb)

Fold string of text with no LF.

See also foldtext which calls this utility on each paragraph.

Syntax

width fold data

foldtext (verb)

Fold text to given width.

Syntax

width foldtext text

Example

   A=: 'In the very middle of the court was a table, with a large dish of tarts upon it.'

   30 foldtext A
In the very middle of the
court was a table, with a
large dish of tarts upon it.

topara (verb)

Convert text to paragraphs.

Syntax

topara text

Replaces single LFs not followed by blanks by spaces, except for LF's at the beginning

Example

   topara 'one',LF,'two',LF2,'three'
one two

three

>>  <<  Usr  Pri  JfC  LJ  Phr  Dic  Voc  !:  Help  User