Documentation ¶
Index ¶
- func ComputePad(s []byte, pad []byte, n int) (padCount, spaceCount int)
- func CountIndex(s, sep []byte) (c, index int)
- func NewIndent(dst *bytes.Buffer, prefix, indent string, depth int)
- func NewLine(dst *bytes.Buffer, prefix, indent string, depth int)
- func PadLeft(s []byte, pad []byte, n int) []byte
- func PadRight(s []byte, pad []byte, n int) []byte
- func Reverse(s []byte) []byte
- func Truncate(s []byte, n int) []byte
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ComputePad ¶
ComputePad returns pad's count and space's count(less than len(pad)) will be need to pad s to len n padCount = (n-len(s))/len(pad) spaceCount = (n-len(s))%len(pad)
func CountIndex ¶
CountIndex counts the number of non-overlapping instances of sep in s. Index returns the index of the first instance of sep in s, or -1 if sep is not present in s.
func PadLeft ¶
PadLeft returns s padded to length n, padded left with repeated pad return s directly if pad is empty padding s with {{pad}} and spaces(less than len(pad)) as a prefix, as [pad]...[pad][space]...[space][s]
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.