RosettaCodeData/Task/Empty-string/Scala/empty-string.scala

11 lines
239 B
Scala

// assign empty string to a variable
val s=""
// check that string is empty
s.isEmpty // true
s=="" // true
s.size==0 // true
// check that string is not empty
s.nonEmpty // false
s!="" // false
s.size>0 // false