package stringext import ( "strings" "golang.org/x/text/cases" "golang.org/x/text/language" ) func Capitalize(text string) string { return cases.Title(language.English, cases.Compact).String(text) } // NormalizeSpace normalizes whitespace in the given content string. // It replaces Windows-style line endings with Unix-style line endings, // converts tabs to four spaces, and trims leading and trailing whitespace. func NormalizeSpace(content string) string { content = strings.ReplaceAll(content, "\r\n", "\n") content = strings.ReplaceAll(content, "\t", " ") content = strings.TrimSpace(content) return content }