Add WriteStringsPrefixed

This commit is contained in:
Bugadinho
2025-09-25 09:23:11 -03:00
parent 2276b9fee0
commit 7853a4a665
+10
View File
@@ -56,6 +56,16 @@ func (sb *stringBuilder) WriteStrings(ss []string, sep string) {
}
}
func (sb *stringBuilder) WriteStringsPrefixed(prefix string, ss []string, sep string) {
prefixedSs := []string{}
for _, s := range ss {
prefixedSs = append(prefixedSs, prefix+s)
}
sb.WriteStrings(prefixedSs, sep)
}
func (sb *stringBuilder) WriteRune(r rune) {
sb.builder.WriteRune(r)
}