mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-13 15:34:38 +01:00
various Tower changes
This commit is contained in:
@@ -2,6 +2,7 @@ package stringsupport
|
||||
|
||||
import (
|
||||
"bytes"
|
||||
"fmt"
|
||||
"io"
|
||||
"strconv"
|
||||
"strings"
|
||||
@@ -96,3 +97,23 @@ func CSVElems(csv string) []int {
|
||||
}
|
||||
return r
|
||||
}
|
||||
|
||||
func CSVGetIndex(csv string, i int) int {
|
||||
s := CSVElems(csv)
|
||||
if i < len(s) {
|
||||
return s[i]
|
||||
}
|
||||
return 0
|
||||
}
|
||||
|
||||
func CSVSetIndex(csv string, i int, v int) string {
|
||||
s := CSVElems(csv)
|
||||
if i < len(s) {
|
||||
s[i] = v
|
||||
}
|
||||
var r []string
|
||||
for j := 0; j < len(s); j++ {
|
||||
r = append(r, fmt.Sprintf(`%d`, s[j]))
|
||||
}
|
||||
return strings.Join(r, ",")
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user