textwrapper

package module
v0.0.0-...-65d8968 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2020 License: MIT Imports: 1 Imported by: 26

README

go-textwrapper

GoDoc Build Status

A writer that wraps long text lines to a specified length

Usage

import (
	"os"

	"github.com/emersion/go-textwrapper"
)

func main() {
	w := textwrapper.New(os.Stdout, "/", 5)

	w.Write([]byte("helloworldhelloworldhelloworld"))
	// Output: hello/world/hello/world/hello/world
}

License

MIT

Documentation

Overview

A writer that wraps long text lines to a specified length.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(w io.Writer, sep string, l int) io.Writer

Returns a writer that splits its input into multiple parts that have the same length and adds a separator between these parts.

func NewRFC822

func NewRFC822(w io.Writer) io.Writer

Creates a RFC822 text wrapper. It adds a CRLF (ie. \r\n) each 76 characters.

Types

This section is empty.

Jump to

Keyboard shortcuts

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