2022-08-04 00:05:19 +02:00
|
|
|
package parsers
|
|
|
|
|
2022-08-15 14:29:43 +02:00
|
|
|
import (
|
|
|
|
"strconv"
|
|
|
|
"strings"
|
|
|
|
)
|
2022-08-04 00:05:19 +02:00
|
|
|
|
|
|
|
func atoi(s string) (int, bool) {
|
|
|
|
v, err := strconv.Atoi(s)
|
|
|
|
if err != nil {
|
|
|
|
return 0, false
|
|
|
|
}
|
|
|
|
return v, true
|
|
|
|
}
|
2022-08-15 14:29:43 +02:00
|
|
|
|
|
|
|
func TrimPrefixSuffix(arr []string, prefix, suffix string) []string {
|
|
|
|
trims := make([]string, 0, len(arr))
|
|
|
|
for _, str := range arr {
|
|
|
|
trims = append(trims, strings.TrimSuffix(strings.TrimPrefix(str, prefix), suffix))
|
|
|
|
}
|
|
|
|
return trims
|
|
|
|
}
|