package string import ( "strconv" "strings" ) func IsEmptyOrNil(s string) bool { return &s == nil || len(s) == 0 } func IsBlank(s string) bool { return strings.TrimSpace(s) == "" } func IsNotBlank(s string) bool { return !IsBlank(s) } func StringToIntSlice(strSlice []string) ([]int, error) { var intSlice []int for _, str := range strSlice { num, err := strconv.Atoi(str) if err != nil { return nil, err } intSlice = append(intSlice, num) } return intSlice, nil } func IntToStringSlice(intSlice []int) []string { var strSlice []string for _, num := range intSlice { strSlice = append(strSlice, strconv.Itoa(num)) } return strSlice } func RemoveEmptyStrings(slice []string) []string { var filteredSlice []string for _, s := range slice { if s != "" { filteredSlice = append(filteredSlice, s) } } return filteredSlice }