RosettaCodeData/Task/Empty-string/Bait/empty-string.bait

17 lines
369 B
Text
Raw Permalink Normal View History

2026-04-30 12:34:36 -04:00
fun main() {
mut e := "" // Declare empty string
e = "" // Assign empty string
// Use either condition to check if the string is empty
if e == "" and e.length == 0 {
println("`e` is an empty string")
}
s := "not empty"
// Use either condition to check if the string is _not_ empty
if s != "" and s.length > 0 {
println("`s` is not an empty string")
}
}