mirror of https://github.com/daffainfo/nuclei.git
18 lines
342 B
Go
18 lines
342 B
Go
|
package deserialization
|
||
|
|
||
|
import "bytes"
|
||
|
|
||
|
func InsertInto(s string, interval int, sep rune) string {
|
||
|
var buffer bytes.Buffer
|
||
|
before := interval - 1
|
||
|
last := len(s) - 1
|
||
|
for i, char := range s {
|
||
|
buffer.WriteRune(char)
|
||
|
if i%interval == before && i != last {
|
||
|
buffer.WriteRune(sep)
|
||
|
}
|
||
|
}
|
||
|
buffer.WriteRune(sep)
|
||
|
return buffer.String()
|
||
|
}
|