MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / SplitStringNL

Function SplitStringNL

internal/util/util.go:243–252  ·  view source on GitHub ↗

Splits a string by adding line breaks at the end of each line

(input string, lineWidth int, nlPrefix ...string)

Source from the content-addressed store, hash-verified

241
242// Splits a string by adding line breaks at the end of each line
243func SplitStringNL(input string, lineWidth int, nlPrefix ...string) string {
244 lines := SplitString(input, lineWidth)
245
246 linePrefix := ""
247 if len(nlPrefix) > 0 {
248 linePrefix = nlPrefix[0]
249 }
250
251 return strings.Join(lines, term.CRLFStr+linePrefix)
252}
253
254func SplitButRespectQuotes(s string) []string {
255

Callers 4

ServerFunction · 0.92
SetFunction · 0.92
TestSplitStringNLFunction · 0.85

Calls 1

SplitStringFunction · 0.85

Tested by 1

TestSplitStringNLFunction · 0.68