summaryrefslogtreecommitdiffstats
path: root/common/text
diff options
context:
space:
mode:
Diffstat (limited to 'common/text')
-rw-r--r--common/text/transform.go22
1 files changed, 0 insertions, 22 deletions
diff --git a/common/text/transform.go b/common/text/transform.go
index 2d51f6c33..f59577803 100644
--- a/common/text/transform.go
+++ b/common/text/transform.go
@@ -45,25 +45,3 @@ func RemoveAccentsString(s string) string {
accentTransformerPool.Put(t)
return s
}
-
-// Chunk splits s into strings of size.
-func Chunk(s string, size int) []string {
- if size >= len(s) {
- return []string{s}
- }
- var chunks []string
- chunk := make([]rune, size)
- l := 0
- for _, r := range s {
- chunk[l] = r
- l++
- if l == size {
- chunks = append(chunks, string(chunk))
- l = 0
- }
- }
- if l > 0 {
- chunks = append(chunks, string(chunk[:l]))
- }
- return chunks
-}