wordwrap

wordwrap

[code]
func Wordwrap(text string, lineWidth int) string {
	wrapped := ""
	newtext := text + " "
	for i := range text {
		if ((i % lineWidth) == 0) && (i > 0) {
			wrapped += "\n"
		}
		wrapped += newtext[i: i+1]
	}
	return wrapped
}
[/code]