wrap

package
v0.19.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 22, 2022 License: Apache-2.0 Imports: 3 Imported by: 1

Documentation

Overview

Package wrap handles simple text wrapping to a fixed number of columns.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func String

func String(s string, numCols uint) string

Wrap a string to the specified number of columns along word breaks (space character). Output will use \n (newline) characters only. No newlines or carriage returns in the input will be preserved, which means that if you pass in text containing several paragraphs you'll get one giant paragraph back. If you wish to avoid that, then split your text into paragraphs and call wrap.String individually on each paragraph.

func WrappingReader

func WrappingReader(r io.Reader, width uint) io.Reader

WrappingReader returns an io.Reader which will wrap lines longer than the given width. All other lines (LF chars) will be preserved.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL