12345678910111213141516171819 |
- package util
- import "strings"
- func TrimHtml(data string) string {
- nlist := strings.Split(data, "\n")
- res := []string{}
- for _, item := range nlist {
- item = strings.Trim(item, " ")
- if item == "" {
- continue
- } else if item == "\r" {
- continue
- } else {
- res = append(res, item)
- }
- }
- return strings.Join(res, "\n")
- }
|