RosettaCodeData/Task/Empty-string/V-(Vlang)/empty-string-1.v

14 lines
241 B
V

// define and initialize an empty string
mut s := ""
// assign an empty string to a variable
s = ""
// check that a string is empty, any of:
s == ""
s.len() == 0
// check that a string is not empty, any of:
s != ""
s.len() != 0 // or > 0