Skip to content

spenserblack/go-wordwrap

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

37 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

wordwrap

CI codecov Go Report Card Go Reference

Wraps words at a given limit. Wraps at whitespace, hyphens (-), and will wrap words that exceed the given limit. See package documentation for more details.

Example

lines := wordwrap.WordWrap("this test-string has been successfully wrapped successfully", 10)
for _, line := range lines {
	fmt.Println(line)
}

Output

this test-
string has
been
successful
ly wrapped
successful
ly