Skip to content

Commit 705372d

Browse files
committed
added SanitizeStringTrimSpace
1 parent 0954807 commit 705372d

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Diff for: strings.go

+6
Original file line numberDiff line numberDiff line change
@@ -17,3 +17,9 @@ func SanitizeString(s string) string {
1717
s,
1818
)
1919
}
20+
21+
// SanitizeStringTrimSpace returns valid UTF-8 only with printable characters
22+
// with leading and trailing whitespace trimmed away.
23+
func SanitizeStringTrimSpace(s string) string {
24+
return strings.TrimSpace(SanitizeString(s))
25+
}

0 commit comments

Comments
 (0)