textwrap

package module
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 27, 2022 License: GPL-3.0 Imports: 2 Imported by: 0

README

textwrap

Go Reference

textwrap is a package made to simplify formatting text in a size limited space.

Usage

Import the package into your project

import "github.com/sha65536/textwrap"

Wrap a text using Wrap

result, err := textwrap.Wrap("Hello There. General Kenobi.", 12)

Will result in:

Hello There.
General
Kenobi.

Documentation

Overview

Package textwrap does the main part of formatting the string

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Wrap

func Wrap(input string, size int) (string, error)

Wrap calls WrapCustom with default paramets And returns the output joined by the line ending.

func WrapCustom

func WrapCustom(input string, size int, delim, end string) ([]string, error)

WrapCustom is the main function of the repo Given an input, and desired size

Types

This section is empty.

Jump to

Keyboard shortcuts

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