1
package mox
2
3
// TXTStrings returns a TXT record value as one or more quoted strings, each max
4
// 100 characters. In case of multiple strings, a multi-line record is returned.
5
func TXTStrings(s string) string {
6
if len(s) <= 100 {
7
return `"` + s + `"`
8
}
9
10
r := "(\n"
11
for len(s) > 0 {
12
n := len(s)
13
if n > 100 {
14
n = 100
15
}
16
if r != "" {
17
r += " "
18
}
19
r += "\t\t\"" + s[:n] + "\"\n"
20
s = s[n:]
21
}
22
r += "\t)"
23
return r
24
}
25