...

Package wordwrap

import "github.com/mitchellh/go-wordwrap"
Overview
Index

Overview ▾

func WrapString

func WrapString(s string, lim uint) string

WrapString wraps the given string within lim width in characters.

Wrapping is currently naive and only happens at white-space. A future version of the library will implement smarter wrapping. This means that pathological cases can dramatically reach past the limit, such as a very long word.