Created
November 14, 2016 12:25
-
-
Save AKosterin/6254f0652f3c348be3bd20df871b5077 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
func separateString(str, seporator string, count int) string { | |
rs := []rune(str) | |
log.Println("rs = ", rs) | |
srs := []rune(seporator) | |
log.Println("srs = ", srs) | |
for i := 0; i * (count + len(srs)) < len(rs)-count; i++ { | |
rs = append(rs[:i * (count + len(srs)) + count] ,append(srs, rs[i * (count + len(srs)) + count :]...)...) | |
} | |
return string(rs) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment