(str string, n int)
| 19 | import "strings" |
| 20 | |
| 21 | func Indent(str string, n int) string { |
| 22 | idnt := strings.Repeat(" ", n) |
| 23 | |
| 24 | lines := strings.Split(str, "\n") |
| 25 | |
| 26 | return idnt + strings.TrimSuffix(strings.Join(lines, "\n"+idnt), "\n"+idnt) |
| 27 | } |
no outgoing calls