// This could be better....break at Capitals or hyphens / underscores
This could be better....break at Capitals or hyphens / underscores
// This could be better .... break at Capitals or hyphens / underscores
func insertSpaces(v string) string {
	if len(v) < 11 {
		return v
	}
	v = insertSpacesAtCertainCharacters(v)
	var buffer bytes.Buffer
	count := 0
	for i, c := range v {
		if string(c) == " " {
			count = 0
		} else {
			if string(c) != " " && string(c) != "\\" && i > 0 && count >= 8 {
				buffer.WriteString(" ")
				count = 0
			}
		}
		buffer.WriteString(string(c))
		count++
	}
	return buffer.String()
}
func insertSpaces ( v string ) string { if len ( v ) < 11 { return v } v = insertSpacesAtCertainCharacters ( v ) var buffer bytes . Buffer count := 0 for i , c := range v { if string ( c ) == " " { count = 0 } else { if string ( c ) != " " && string ( c ) != " \\ " && i > 0 && count >= 8 { buffer . WriteString ( " " ) count = 0 } } buffer . WriteString ( string ( c ) ) count ++ } return buffer . String ( ) }
This could be better....break at Capitals or hyphens / underscores
This could be better .... break at Capitals or hyphens / underscores