2015-02-20 00:35:01 -05:00
|
|
|
// define and initialize an empty string
|
|
|
|
|
var s string
|
|
|
|
|
s2 := ""
|
|
|
|
|
|
|
|
|
|
// assign an empty string to a variable
|
2013-04-10 16:57:12 -07:00
|
|
|
s = ""
|
|
|
|
|
|
2015-02-20 00:35:01 -05:00
|
|
|
// check that a string is empty, any of:
|
2013-04-10 16:57:12 -07:00
|
|
|
s == ""
|
2015-02-20 00:35:01 -05:00
|
|
|
len(s) == 0
|
2013-04-10 16:57:12 -07:00
|
|
|
|
2015-02-20 00:35:01 -05:00
|
|
|
// check that a string is not empty, any of:
|
|
|
|
|
s != ""
|
|
|
|
|
len(s) != 0 // or > 0
|