MCPcopy Index your code
hub / github.com/tbphp/gpt-load / TruncateString

Function TruncateString

internal/utils/string_utils.go:26–31  ·  view source on GitHub ↗

TruncateString shortens a string to a maximum length.

(s string, maxLength int)

Source from the content-addressed store, hash-verified

24
25// TruncateString shortens a string to a maximum length.
26func TruncateString(s string, maxLength int) string {
27 if len(s) > maxLength {
28 return s[:maxLength]
29 }
30 return s
31}
32
33// SplitAndTrim splits a string by a separator
34func SplitAndTrim(s string, sep string) []string {

Callers 1

logRequestMethod · 0.92

Calls

no outgoing calls

Tested by

no test coverage detected