14 lines
239 B
Go
14 lines
239 B
Go
package main
|
|
|
|
import "strings"
|
|
|
|
// firstLine is the first non-empty line of s, trimmed.
|
|
func firstLine(s string) string {
|
|
for _, l := range strings.Split(s, "\n") {
|
|
if l = strings.TrimSpace(l); l != "" {
|
|
return l
|
|
}
|
|
}
|
|
return ""
|
|
}
|