Skip to content

Commit 009947e

Browse files
committed
Add WriteStringsPrefixed
1 parent 044cf35 commit 009947e

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

stringbuilder.go

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,6 +56,16 @@ func (sb *stringBuilder) WriteStrings(ss []string, sep string) {
5656
}
5757
}
5858

59+
func (sb *stringBuilder) WriteStringsPrefixed(prefix string, ss []string, sep string) {
60+
prefixedSs := []string{}
61+
62+
for _, s := range ss {
63+
prefixedSs = append(prefixedSs, prefix+s)
64+
}
65+
66+
sb.WriteStrings(prefixedSs, sep)
67+
}
68+
5969
func (sb *stringBuilder) WriteRune(r rune) {
6070
sb.builder.WriteRune(r)
6171
}

0 commit comments

Comments
 (0)