SplitAndTrim splits string, trims every entry and removes blank entries
(str string)
| 43 | |
| 44 | // SplitAndTrim splits string, trims every entry and removes blank entries |
| 45 | func SplitAndTrim(str string) (res []string) { |
| 46 | split := strings.Split(str, ",") |
| 47 | for _, s := range split { |
| 48 | s = strings.Trim(s, " ") |
| 49 | if len(s) > 0 { |
| 50 | res = append(res, s) |
| 51 | } |
| 52 | } |
| 53 | return |
| 54 | } |
| 55 | |
| 56 | // StringsContain returns true if provided string slice contains provided string |
| 57 | func StringsContain(strs []string, str string) bool { |
no outgoing calls
no test coverage detected
searching dependent graphs…