Empty string: Difference between revisions

Line 1,111:
 
func main() {
// Demonstrate how to assign an empty string to a variable.
str1 := ""
str2 := " "
// check if a string or []string is empty.
test(str1) // prt empty
// Demonstrate how to check that a string is not empty.
test(str2) // prt not empty
}</lang>
Anonymous user