1 package stringsx 2 3 // Coalesce returns the first non-empty string value 4 func Coalesce(str ...string) string { 5 for _, s := range str { 6 if s != "" { 7 return s 8 } 9 } 10 return "" 11 } 12
View as plain text