package utils

import (
	"strings"
)

func SplitStrings(text string, count int) string {
	words := strings.Split(text, " ")
	var result strings.Builder

	for i := 0; i < len(words); i += count {
		if i+count < len(words) {
			result.WriteString(strings.Join(words[i:i+count], " ") + "\n")
		} else {
			result.WriteString(strings.Join(words[i:], " "))
		}
	}

	return result.String()
}
